It is not entirely clear that patents would help much in that.
If it is not possible to keep something secret, patents would only help if people otherwise really would keep inventions secret. But there are ways to gain even without secrecy -- first-mover advantage, etc. -- and inventors would be attracted to those rather than nothing at all.
If it is possible to keep something secret, then those motivated by the gains from patents would choose secrecy in preference, since secrecy is an even stronger monopoly.
If it is not possible to keep something secret, patents would only help if people otherwise really would keep inventions secret. But there are ways to gain even without secrecy -- first-mover advantage, etc. -- and inventors would be attracted to those rather than nothing at all.
If it is possible to keep something secret, then those motivated by the gains from patents would choose secrecy in preference, since secrecy is an even stronger monopoly.