http://bugs.winehq.org/show_bug.cgi?id=2082
--- Comment #132 from Ken Thomases ken@codeweavers.com --- (In reply to comment #131)
We also have tests that show that switching to fullscreen does have an effect on e.g. window dimensions, z-order and focus.
I found tests for the foreground window in dlls/ddraw/tests/ddrawmodes.c, testcooperativelevels_normal() and testcooperativelevels_exclusive(). I didn't find other tests related to z-order. Please let me know if I missed them.
As we've seen with this bug, a window may be the foreground window without being front-most, in particular if it owns other windows. Also if it's non-topmost and there are topmost windows.
I'll try to extend the tests to test some possibilities with respect to actual z-order viz-a-viz owned, topmost, and other windows.
With respect to a WGL extension, were you thinking of something like an alternative to wglMakeCurrent() such as wglMakeCurrentFullScreenWINE()?
--- Comment #133 from Ken Thomases ken@codeweavers.com --- Created attachment 47148 --> http://bugs.winehq.org/attachment.cgi?id=47148 Test z-order in ddraw tests
To my surprise, SetForegroundWindow() has nothing to do with z-order, at all. It just affects foreground/active statuses which are related to focus.
This patch modifies the ddraw tests to check z-order. In all of the places that used to call SetForegroundWindow(), I now also call SetWindowPos(…, HWND_TOP, …). In all of the places that checked the window returned from GetForegroundWindow(), I now also check the window order. I also check the z-order immediately after attempting to set it to verify that it's working.
The tests marked "todo_wine" in testcooperativelevels_normal() are due to ddraw/wined3d setting the window topmost for fullscreen and, in some cases, not restoring it.
For testcooperativelevels_exclusive(), I make sure neither window is topmost before proceeding. I also create two other windows, one topmost and one owned by the main window. I test that both remain in front of the main window even when it's fullscreen. Wine keeps the owned one in front (which is at the root of this bug) but, as expected, promotes the main window to topmost, bringing it in front of the other topmost window, when it shouldn't.