Browse Source

Fixed window resizing when entering and leaving fullscreen mode

Sam Lantinga 11 years ago
parent
commit
8f8070db42
1 changed files with 7 additions and 4 deletions
  1. 7 4
      src/video/cocoa/SDL_cocoawindow.m

+ 7 - 4
src/video/cocoa/SDL_cocoawindow.m

@@ -452,18 +452,21 @@ GetWindowStyle(SDL_Window * window)
 
 
 - (void)windowWillExitFullScreen:(NSNotification *)aNotification
 - (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;
     isFullscreen = NO;
     inFullscreenTransition = YES;
     inFullscreenTransition = YES;
 }
 }
 
 
 - (void)windowDidExitFullScreen:(NSNotification *)aNotification
 - (void)windowDidExitFullScreen:(NSNotification *)aNotification
 {
 {
-    SDL_Window *window = _data->window;
     NSWindow *nswindow = _data->nswindow;
     NSWindow *nswindow = _data->nswindow;
 
 
-    if (!(window->flags & SDL_WINDOW_RESIZABLE)) {
-        [nswindow setStyleMask:GetWindowStyle(window)];
-    }
     inFullscreenTransition = NO;
     inFullscreenTransition = NO;
 
 
     if (pendingWindowOperation == PENDING_OPERATION_ENTER_FULLSCREEN) {
     if (pendingWindowOperation == PENDING_OPERATION_ENTER_FULLSCREEN) {