Commit 14bf230d76a1eae6b6ea54a938a991a9f2632750

J?rgen P. Tjern? 2013-08-12T11:09:13

Mac: Fix restoring of Cmd-H-hidden fullscreen desktop windows. This should fix http://bugzilla.libsdl.org/show_bug.cgi?id=1996

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m
index 9cee4d3..cd4771d 100644
--- a/src/video/cocoa/SDL_cocoawindow.m
+++ b/src/video/cocoa/SDL_cocoawindow.m
@@ -1047,9 +1047,11 @@ Cocoa_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display
         [nswindow setLevel:kCGNormalWindowLevel];
     }
 
-    [data->listener pauseVisibleObservation];
-    [nswindow makeKeyAndOrderFront:nil];
-    [data->listener resumeVisibleObservation];
+    if ([nswindow isVisible] || fullscreen) {
+        [data->listener pauseVisibleObservation];
+        [nswindow makeKeyAndOrderFront:nil];
+        [data->listener resumeVisibleObservation];
+    }
 
     ScheduleContextUpdates(data);