Commit 8f8070db42bafc8edbd217d1908a438b145d2a67

Sam Lantinga 2013-11-11T21:38:11

Fixed window resizing when entering and leaving fullscreen mode

diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m
index 1e5c24f..be6f6cf 100644
--- a/src/video/cocoa/SDL_cocoawindow.m
+++ b/src/video/cocoa/SDL_cocoawindow.m
@@ -452,18 +452,21 @@ GetWindowStyle(SDL_Window * window)
 
 - (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) {