http://bugs.winehq.org/show_bug.cgi?id=27190
--- Comment #3 from Jarek jarekczek@poczta.onet.pl 2011-07-03 11:40:13 CDT --- Mateus, together we're getting closer and closer to it :) With your simple application and WINEDEBUG=+message wine Project1.exe I discovered that set_active_window (dlls/user32/focus.c) is called twice while it should be called only once.
Here's the output of
CHAR szWnd[200]; GetWindowTextA(hwnd, szWnd, 199); printf("//BS set_active_window %s %lu (prev %lu, prevAct %lu)\n", szWnd, hwnd, prev ? *prev : 0, previous);
put at the beginning of set_active_window
Proper behaviour (mouse activation): //BS set_active_window Form1 853072 (prev 0, prevAct 0)
Bogus behaviour (keyboard activation) //BS set_active_window Project1 853094 (prev 0, prevAct 0) //BS set_active_window Form1 853072 (prev 0, prevAct 853094)
When the second activation is executed, kill focus is send to Project1 window and we're struck :(
And what's interesting even the initial sequence of activation creates ill state with the main window out of focus. Here's the log: //BS set_active_window Form1 853072 (prev 0, prevAct 0) //BS set_active_window Form1 853072 (prev 0, prevAct 853072) //BS set_active_window Project1 853094 (prev 0, prevAct 853072) //BS set_active_window Form1 853072 (prev 0, prevAct 853094)
At the moment I'm tired and let up. I'll come to it back later if no one fixes that.
What I'm afraid of is that it may be hard to correct. I remember Jack having problems with getting out of visibility when switching windows through Alt-tab. It was corrected like a year ago. If less windows get activated, some apps may become invisible again.