[vlc-commits] macosx: only revert presentation options on fullscreen leave which are touched when entering fs for this particular window

David Fuhrmann git at videolan.org
Fri Feb 15 20:23:48 CET 2013


vlc | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Fri Feb 15 19:12:21 2013 +0100| [57df1568f65061f449f9664770b609296ffd7203] | committer: David Fuhrmann

macosx: only revert presentation options on fullscreen leave which are touched when entering fs for this particular window

This fixes menu / dock hide behaviour when handling around with multiple
vout windows which are set to fullscreen on multiple monitors, especially when
leaving fullscreen for one window with other windows still in fullscreen state.

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

 modules/gui/macosx/Windows.m |    4 ++--
 modules/gui/macosx/misc.h    |    3 +++
 modules/gui/macosx/misc.m    |   13 +++++++++++--
 3 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/modules/gui/macosx/Windows.m b/modules/gui/macosx/Windows.m
index 2b39924..b213f9e 100644
--- a/modules/gui/macosx/Windows.m
+++ b/modules/gui/macosx/Windows.m
@@ -930,7 +930,7 @@
         }
 
         [[[VLCMainWindow sharedInstance] fsPanel] setNonActive: nil];
-        [NSApp setPresentationOptions: NSApplicationPresentationDefault];
+        [[o_fullscreen_window screen] setNonFullscreenPresentationOptions];
 
         /* Will release the lock */
         [self hasEndedFullscreen];
@@ -952,7 +952,7 @@
     [[o_video_view window] orderFront: self];
 
     [[[VLCMainWindow sharedInstance] fsPanel] setNonActive: nil];
-    [NSApp setPresentationOptions:(NSApplicationPresentationDefault)];
+    [[o_fullscreen_window screen] setNonFullscreenPresentationOptions];
 
     if (o_fullscreen_anim1) {
         [o_fullscreen_anim1 stopAnimation];
diff --git a/modules/gui/macosx/misc.h b/modules/gui/macosx/misc.h
index 9d9767c..a523c9e 100644
--- a/modules/gui/macosx/misc.h
+++ b/modules/gui/macosx/misc.h
@@ -65,6 +65,9 @@
 - (CGDirectDisplayID)displayID;
 - (void)blackoutOtherScreens;
 + (void)unblackoutScreens;
+
+- (void)setFullscreenPresentationOptions;
+- (void)setNonFullscreenPresentationOptions;
 @end
 
 
diff --git a/modules/gui/macosx/misc.m b/modules/gui/macosx/misc.m
index 4d07d8e..502bfd9 100644
--- a/modules/gui/macosx/misc.m
+++ b/modules/gui/macosx/misc.m
@@ -256,10 +256,9 @@ static NSMutableArray *blackoutWindows = NULL;
 
     for (NSUInteger i = 0; i < blackoutWindowCount; i++) {
         VLCWindow *blackoutWindow = [blackoutWindows objectAtIndex: i];
+        [[blackoutWindow screen] setNonFullscreenPresentationOptions];
         [blackoutWindow closeAndAnimate: YES];
     }
-
-    [NSApp setPresentationOptions:(NSApplicationPresentationDefault)];
 }
 
 - (void)setFullscreenPresentationOptions
@@ -272,6 +271,16 @@ static NSMutableArray *blackoutWindows = NULL;
     [NSApp setPresentationOptions:presentationOpts];
 }
 
+- (void)setNonFullscreenPresentationOptions
+{
+    NSApplicationPresentationOptions presentationOpts = [NSApp presentationOptions];
+    if ([self hasMenuBar])
+        presentationOpts &= (~NSApplicationPresentationAutoHideMenuBar);
+    if ([self hasMenuBar] || [self hasDock])
+        presentationOpts &= (~NSApplicationPresentationAutoHideDock);
+    [NSApp setPresentationOptions:presentationOpts];
+}
+
 @end
 
 /*****************************************************************************



More information about the vlc-commits mailing list