]> git.sesse.net Git - vlc/commitdiff
macosx: workaround for bug where window will vanish if minimized in float-on-top...
authorDavid Fuhrmann <david.fuhrmann@googlemail.com>
Sun, 26 Jan 2014 16:07:44 +0000 (17:07 +0100)
committerDavid Fuhrmann <david.fuhrmann@googlemail.com>
Sun, 26 Jan 2014 17:02:38 +0000 (18:02 +0100)
modules/gui/macosx/Windows.m

index 032ac24ae73c383c4ed3b45df92f5446299d38e0..73ae04c1d5286ea631354922e7005436314502f5 100644 (file)
 
     if (!b_fullscreen && !b_entering_fullscreen_transition)
         [self setLevel: i_state];
-    else {
-        // only save it for restore
-        i_originalLevel = i_state;
-    }
+
+    // save it for restore if window is currently minimized or in fullscreen
+    i_originalLevel = i_state;
 }
 
 - (NSRect)getWindowRectForProposedVideoViewSize:(NSSize)size
     return proposedFrameSize;
 }
 
+- (void)windowWillMiniaturize:(NSNotification *)notification
+{
+    // Set level to normal as a workaround for Mavericks bug causing window
+    // to vanish from screen, see radar://15473716
+    i_originalLevel = [self level];
+    [self setLevel: NSNormalWindowLevel];
+}
+
+- (void)windowDidDeminiaturize:(NSNotification *)notification
+{
+    [self setLevel: i_originalLevel];
+}
 
 #pragma mark -
 #pragma mark Mouse cursor handling