I'd also like to note that the quid-pro-quo model of patents suggests that, in fact, it shouldn't be enough for the solution to be non-obvious: It should have to be non-obvious even once you have been told such a thing exists. Because if the mere knowledge of the existence of something would be sufficient to render how to do it obvious, the inventor cannot hope to keep its workings secret once it is released, and so we are trading for something that would be worthless anyway.
there's a logical flaw in your argument, though, because where you say "we are trading for something that would be worthless anyway" it assumes the choice is between "trade secret" and "disclosed." But there is really also a choice between "trade secret, people know it exists and what it does but must guess at how" and "trade secret, no one knows it exists or what it does".
In other words, for some kinds of trade secrets, perhaps inventors might not even let you know of the existence of their invention, since without legal protection this knowledge would render the competitive advantage it confers worthless - even though before disclosure, skilled practitioners did not think to use it, as it is quite novel and those skilled in the art have not come up with it despite its obvious utility once disclosed.
Thus inventors might secretly enjoy its benefits or fruits. (This is easy enough to imagine; there could be a closely guarded manufacturing process in use right now that the public and other manufactuers do not even knows exists, and is not in the final product. The manufacturer simply makes an end product more cheaply, say. But telling us what the process is would give it away.)
Imagine, for example, that Google uses some kind of trade secret as part of ranking web pages. We don't even know what the process is, let alone how it is done. Naming the process would render it public and unprotected. So, it remains the only search engine that uses it, secretly.
There is a second part of the patent quid pro quo deal that is often glossed over and that is "... without undue experimentation". For many ideas, the idea is enough to allow someone to reproduce it, but for a large subset of those ideas, a person skilled in the art would still have to go through undue experimentation if there is no source code available.
Source code is often the only way for someone to recreate an idea disclosed via software patent without undue experimentation.
I've always wondered - why isn't source code disclosed in a software patent? In most other mechanical inventions or even pharmaceutical ones, the type of disclosure required does include a fair bit of detail - perhaps blueprints of some sort and certainly lots of diagrams and explanations. Wouldn't the software equivalent of that be the source code, rather than, say, screenshots?