Hello!
My patch for fixing the focus of some programs (notepad, winecfg) on startup hasn't been applied, so I'm guessing what the reason might be.
One reason may be that the testing could have found another bug that might seem to be related. When Wine uses non-managed windows without desktop, they don't get the keyboard focus initially. It affects even programs what show active captions, such as Winemine.
When Winemine is started, the keyboard events go to the original window. The same happens after the "About" dialog is run. But when the "About" dialog is dismissed, the main window of Winemine gets keyboard focus. It seems to be another example of not doing something because the initial window is "already focused".
This is a separate problem, it affects a wider class of programs and doesn't affect Wine in the desktop mode. If fixing this is considered precondition to fixing all other focus problems, I'd like to know that.
Another possible reason I can think of is because SetFocus is supposed to affect widgets before the application window is shown. That's something that needs testing. I've made a patch that only disables activation of the parent window if it's invisible, but still focuses the window for which SetFocus() was called.
The patch is attached. Before I start time-consuming verification, I'd like to know if I going in the right direction.
There is another, third focus problem. Windows should not cover modal dialogs. Shareware Windows Commander 5.0 is useless in the desktop mode because the main window covers the "nag screen" on startup. The workaround is to enter "foo" in the command line and press Enter - there will be an error message, and after it's dismissed, the "nag screen" will pop up. Again, it's a separate problem that I'm not trying to solve at this point.
I'll appreciate an advise in which order to proceed and what kind of verification is expected for the changes in the focus code.