[vlc-commits] macosx: workaround for bug where window will vanish if minimized in float-on-top mode

David Fuhrmann git at videolan.org
Sun Jan 26 18:26:13 CET 2014


vlc | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Sun Jan 26 17:07:44 2014 +0100| [38e14c073d735e7bce486752e1db2343701eb890] | committer: David Fuhrmann

macosx: workaround for bug where window will vanish if minimized in float-on-top mode

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=38e14c073d735e7bce486752e1db2343701eb890
---

 modules/gui/macosx/Windows.m |   19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/modules/gui/macosx/Windows.m b/modules/gui/macosx/Windows.m
index 032ac24..73ae04c 100644
--- a/modules/gui/macosx/Windows.m
+++ b/modules/gui/macosx/Windows.m
@@ -467,10 +467,9 @@
 
     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
@@ -556,6 +555,18 @@
     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



More information about the vlc-commits mailing list