https://bugs.winehq.org/show_bug.cgi?id=52519
Bug ID: 52519 Summary: SDL 2.0.20 reports wrong FOCUS_GAINED event when minimizing an inactive fullscreen window Product: Wine Version: 7.1 Hardware: x86-64 OS: Linux Status: NEW Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: madewokherd@gmail.com Distribution: ---
Created attachment 71817 --> https://bugs.winehq.org/attachment.cgi?id=71817 test case (C source)
SDL will, in some cases, minimize fullscreen windows when they are deactivated. If this happens in SDL 2.0.20, it will report a FOCUS_LOST event followed by a FOCUS_GAINED event. It should only report the FOCUS_GAINED event when the window is restored, which is what happens on Windows.
Also reported here: https://github.com/libsdl-org/SDL/issues/5316
Test program attached. This requires SDL.
To reproduce the bug: * Run the test program in Wine with SDL_EVENT_LOGGING=1 * Click the window to fullscreen it. * Alt+tab to another window. * The last focus event logged was FOCUS_GAINED.
I know this happens because SDL receives a WM_ACTIVATE message indicating that the window is minimized, but GetForegroundWindow reports that the application is still in the foreground. SDL responds to WM_ACTIVATE by "resyncing" focus, so it responds to this by reporting FOCUS_GAINED.
I haven't been able to figure out the exact set of circumstances that cause this behavior in Wine, so I couldn't make a test case that doesn't require SDL.