| Summary: | Cocoa - Incorrect window size when leaving fullscreen | ||
|---|---|---|---|
| Product: | SDL | Reporter: | bastien.bouclet |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | ASSIGNED --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | dll, sezeroz |
| Version: | 2.0.5 | ||
| Hardware: | x86_64 | ||
| OS: | Mac OS X 10.10 | ||
| Attachments: | Minimal test case | ||
Downstream bug report: https://bugs.scummvm.org/ticket/9971 (Sorry if you get a lot of copies of this email, we're touching dozens of bug reports right now.) Tagging a bunch of bugs as target-2.0.6. This means we're in the final stretch for an official SDL 2.0.6 release! These are the bugs we really want to fix before shipping if humanly possible. That being said, we don't promise to fix them because of this tag, we just want to make sure we don't forget to deal with them before we bless a final 2.0.6 release, and generally be organized about what we're aiming to ship. After some debate, we might just remove this tag again and deal with it for a later release. Hopefully you'll hear more about this bug soon. If you have more information (including "this got fixed at some point, nevermind"), we would love to have you come add more information to the bug report when you have a moment. Thanks! --ryan. Fixed, thanks! https://hg.libsdl.org/SDL/rev/f9d5845f2311 Thanks. The window is now resized to its specified size, but it moves to the top left corner of the screen. That is unexpected because neither the user nor the program moved it there. Test program attached (the same one as before). This should be fixed by David Ludwig's patch: https://hg.libsdl.org/SDL/rev/f76299105635 Unfortunately the window still moves to the top left corner of the screen after resizing: https://www.youtube.com/watch?v=T1s0nEvWzrE Odd. I had the window-move bug reproduce for me at one point. I am no longer able to, even when I revert the patch that I applied, and when I revert to just-before the initial patch. Correction: I am unable to reproduce the window-move bug when using SDL just-after the initial patch was applied, in addition to just-before and just-after my followup patch (which targeted a separate bug). This is on macOS 10.12.6, Xcode 8.3.3, and the macOS 10.12 SDK, compiling both the attached code, as well as one of my own test apps. Might the window-move bug be system specific? I'm not seeing this either, using the minimal test case you provided. Can you check the window origin here and make sure it's not 0?
/* Restore windowed size and position in case it changed while fullscreen */
{
NSRect rect;
rect.origin.x = window->windowed.x;
rect.origin.y = window->windowed.y;
rect.size.width = window->windowed.w;
rect.size.height = window->windowed.h;
ConvertNSRect([nswindow screen], NO, &rect);
s_moveHack = 0;
[nswindow setContentSize:rect.size];
[nswindow setFrameOrigin:rect.origin];
s_moveHack = SDL_GetTicks();
}
Using the attached test case : window->windowed.x: 0 window->windowed.y: 22 Those values come from a "windowDidMove" callback that is received while leaving fullscreen (before trying to resize the window). This is using OSX 10.10.5. Thanks, I can reproduce this in a VM running OSX 10.10. Fixed, thanks! https://hg.libsdl.org/SDL/rev/05aa6d232dca The fix for this bug introduced bug 3809, so I'm backing it out for SDL 2.0.6 release, until we have a chance to properly handle maximize/restore transitions. |
Created attachment 2812 [details] Minimal test case When exiting a "fullscreen space" on OS X, windows don't go to their defined "windowed mode size", but go back to their previous size. Steps to reproduce: 1. Create a windowed mode SDL window 2. Toggle it to fullscreen with the SDL_WINDOW_FULLSCREEN_DESKTOP flag 3. While in fullscreen, change the windowed mode size using SDL_SetWindowSize 4. Toggle the window back to windowed mode Expected result: - The window has the size specified during step 3. Actual result: - The window has the size specified when creating the window in step 1. Attached is a minimal reproduction test case. The attached test case works as expected on X11 and Windows.