| Summary: | Exiting fullscreen on Windows can cause resizing of other windows | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Simon Hug <chli.hug> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | amaranth72, philipp.wiesemann |
| Version: | HG 1.2 | ||
| Hardware: | All | ||
| OS: | Windows (All) | ||
| Attachments: |
Diff for a fix.
Fixes the mode change in SDL2. |
||
Created attachment 2442 [details]
Fixes the mode change in SDL2.
I thought only SDL 1.2 is affected, but SDL 2 is doing the same thing. Here's a patch for SDL 2.
Applied via https://hg.libsdl.org/SDL/rev/e49caa693be5 and https://hg.libsdl.org/SDL/rev/7cbfd97f1430 , thanks! The applied patch for SDL 2.0 [1] partially reverted an earlier fix for switching from fullscreen to window. [2] It looks like this would handle the case where the resolution is the same. However, I do not know if the earlier problem still exists or which is more important now. :) [1] https://hg.libsdl.org/SDL/rev/7cbfd97f1430 [2] https://hg.libsdl.org/SDL/rev/513d97ffe10d I do remember that earlier problem before it was fixed, but I can't reproduce it now even after the latest commits. Can anyone else? I do not get the black screen even if I remove the older fix. So either the black screen is currently prevented from elsewhere or I did something wrong. :) Also, I get no resized windows with and without the newer fix (for SDL 2.0). SDL_WINDOW_FULLSCREEN was used (not SDL_WINDOW_FULLSCREEN_DESKTOP). Yeah, I don't get any of these mode changes on exit when removing the newer lines in tip. And there's no actual call to WIN_SetDisplayMode on exiting when testing the parent of [1] so I'm wondering where that comes from. Well, seems fixed now, right? Now, other windows moving or resizing when exiting fullscreen is a bit harder to reproduce, I guess. I'm currently testing on Windows 8.1 and the CDS_FULLSCREEN flag definitely did help, although in my case the windows are not resizing but just moving to the lower-right corner if I leave out the flag. Google Chrome is behaving a bit weird though. It seems this program always wants to fit somehow and resizes itself. (Do they watch for mode changes?) [1] https://hg.libsdl.org/SDL/rev/513d97ffe10d |
Created attachment 2436 [details] Diff for a fix. When SDL exits fullscreen on Windows, the mode change is not marked as temporary. This causes windows resized and icons on the desktop moved if it exists from a small resolution. To fix this, the call to ChangeDisplaySettings should mark the change as temporary.