Fixed window resizing when entering and leaving fullscreen mode
authorSam Lantinga <slouken@libsdl.org>
Mon, 11 Nov 2013 21:38:11 -0800
changeset 7964 56431f7d8f46
parent 7963 f06bbd9cd708
child 7965 d3cbe8ecb1af
Fixed window resizing when entering and leaving fullscreen mode
src/video/cocoa/SDL_cocoawindow.m
--- a/src/video/cocoa/SDL_cocoawindow.m	Mon Nov 11 21:21:18 2013 -0800
+++ b/src/video/cocoa/SDL_cocoawindow.m	Mon Nov 11 21:38:11 2013 -0800
@@ -452,18 +452,21 @@
 
 - (void)windowWillExitFullScreen:(NSNotification *)aNotification
 {
+    SDL_Window *window = _data->window;
+    NSWindow *nswindow = _data->nswindow;
+
+    if (!(window->flags & SDL_WINDOW_RESIZABLE)) {
+        [nswindow setStyleMask:GetWindowStyle(window)];
+    }
+
     isFullscreen = NO;
     inFullscreenTransition = YES;
 }
 
 - (void)windowDidExitFullScreen:(NSNotification *)aNotification
 {
-    SDL_Window *window = _data->window;
     NSWindow *nswindow = _data->nswindow;
 
-    if (!(window->flags & SDL_WINDOW_RESIZABLE)) {
-        [nswindow setStyleMask:GetWindowStyle(window)];
-    }
     inFullscreenTransition = NO;
 
     if (pendingWindowOperation == PENDING_OPERATION_ENTER_FULLSCREEN) {