mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-20 22:16:49 +01:00
Fixed bug 3719 - Cocoa - Incorrect window size when leaving fullscreen
bastien.bouclet 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 commit is contained in:
parent
fcd9c19022
commit
676c3a9263
@ -520,6 +520,11 @@ SetWindowStyle(SDL_Window * window, NSUInteger style)
|
|||||||
NSRect rect = [nswindow contentRectForFrameRect:[nswindow frame]];
|
NSRect rect = [nswindow contentRectForFrameRect:[nswindow frame]];
|
||||||
ConvertNSRect([nswindow screen], fullscreen, &rect);
|
ConvertNSRect([nswindow screen], fullscreen, &rect);
|
||||||
|
|
||||||
|
if (inFullscreenTransition) {
|
||||||
|
/* We'll take care of this at the end of the transition */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (s_moveHack) {
|
if (s_moveHack) {
|
||||||
SDL_bool blockMove = ((SDL_GetTicks() - s_moveHack) < 500);
|
SDL_bool blockMove = ((SDL_GetTicks() - s_moveHack) < 500);
|
||||||
|
|
||||||
@ -719,6 +724,7 @@ SetWindowStyle(SDL_Window * window, NSUInteger style)
|
|||||||
*/
|
*/
|
||||||
window->w = 0;
|
window->w = 0;
|
||||||
window->h = 0;
|
window->h = 0;
|
||||||
|
[self windowDidMove:aNotification];
|
||||||
[self windowDidResize:aNotification];
|
[self windowDidResize:aNotification];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -727,13 +733,13 @@ SetWindowStyle(SDL_Window * window, NSUInteger style)
|
|||||||
{
|
{
|
||||||
SDL_Window *window = _data->window;
|
SDL_Window *window = _data->window;
|
||||||
|
|
||||||
|
isFullscreenSpace = NO;
|
||||||
|
inFullscreenTransition = YES;
|
||||||
|
|
||||||
/* As of OS X 10.11, the window seems to need to be resizable when exiting
|
/* As of OS X 10.11, the window seems to need to be resizable when exiting
|
||||||
a Space, in order for it to resize back to its windowed-mode size.
|
a Space, in order for it to resize back to its windowed-mode size.
|
||||||
*/
|
*/
|
||||||
SetWindowStyle(window, GetWindowStyle(window) | NSWindowStyleMaskResizable);
|
SetWindowStyle(window, GetWindowStyle(window) | NSWindowStyleMaskResizable);
|
||||||
|
|
||||||
isFullscreenSpace = NO;
|
|
||||||
inFullscreenTransition = YES;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)windowDidFailToExitFullScreen:(NSNotification *)aNotification
|
- (void)windowDidFailToExitFullScreen:(NSNotification *)aNotification
|
||||||
@ -801,6 +807,7 @@ SetWindowStyle(SDL_Window * window, NSUInteger style)
|
|||||||
*/
|
*/
|
||||||
window->w = 0;
|
window->w = 0;
|
||||||
window->h = 0;
|
window->h = 0;
|
||||||
|
[self windowDidMove:aNotification];
|
||||||
[self windowDidResize:aNotification];
|
[self windowDidResize:aNotification];
|
||||||
|
|
||||||
/* FIXME: Why does the window get hidden? */
|
/* FIXME: Why does the window get hidden? */
|
||||||
|
Loading…
Reference in New Issue
Block a user