[vlc-commits] macosx: Fix hiding of controls bar in native fullscreen

David Fuhrmann git at videolan.org
Thu Jun 15 21:08:06 CEST 2017


vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Thu Jun 15 20:32:55 2017 +0200| [86089eb0a5973c1c88e0f6ec1720bdf0275d834c] | committer: David Fuhrmann

macosx: Fix hiding of controls bar in native fullscreen

Introduce helper methods to hide and unhide the controls bar
correctly in all cases.

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

 modules/gui/macosx/VLCMainWindow.m |  6 +++---
 modules/gui/macosx/Windows.h       |  3 +++
 modules/gui/macosx/Windows.m       | 18 ++++++++++++++----
 3 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/modules/gui/macosx/VLCMainWindow.m b/modules/gui/macosx/VLCMainWindow.m
index 5067e55d36..4009a5abf2 100644
--- a/modules/gui/macosx/VLCMainWindow.m
+++ b/modules/gui/macosx/VLCMainWindow.m
@@ -783,11 +783,11 @@ static const float f_min_window_height = 307.;
     }
 
     if (self.nativeFullscreenMode) {
-        if ([self hasActiveVideo] && [self fullscreen]) {
-            [[self.controlsBar bottomBarView] setHidden: b_videoPlayback];
+        if ([self hasActiveVideo] && [self fullscreen] && b_videoPlayback) {
+            [self hideControlsBar];
             [self.fspanel setActive];
         } else {
-            [[self.controlsBar bottomBarView] setHidden: NO];
+            [self showControlsBar];
             [self.fspanel setNonActive];
         }
     }
diff --git a/modules/gui/macosx/Windows.h b/modules/gui/macosx/Windows.h
index 6bd62c2620..e228188765 100644
--- a/modules/gui/macosx/Windows.h
+++ b/modules/gui/macosx/Windows.h
@@ -86,6 +86,9 @@ static const float f_min_video_height = 70.0;
 - (void)leaveFullscreenWithAnimation:(BOOL)b_animation;
 
 /* lion fullscreen handling */
+- (void)hideControlsBar;
+- (void)showControlsBar;
+
 - (void)windowWillEnterFullScreen:(NSNotification *)notification;
 - (void)windowDidEnterFullScreen:(NSNotification *)notification;
 - (void)windowWillExitFullScreen:(NSNotification *)notification;
diff --git a/modules/gui/macosx/Windows.m b/modules/gui/macosx/Windows.m
index bb2e80ee5c..8a02532fe9 100644
--- a/modules/gui/macosx/Windows.m
+++ b/modules/gui/macosx/Windows.m
@@ -595,6 +595,18 @@
 #pragma mark -
 #pragma mark Lion native fullscreen handling
 
+- (void)hideControlsBar
+{
+    [[self.controlsBar bottomBarView] setHidden: YES];
+    self.videoViewBottomConstraint.priority = 1;
+}
+
+- (void)showControlsBar
+{
+    [[self.controlsBar bottomBarView] setHidden: NO];
+    self.videoViewBottomConstraint.priority = 999;
+}
+
 - (void)becomeKeyWindow
 {
     [super becomeKeyWindow];
@@ -695,8 +707,7 @@
     }
 
     if (![_videoView isHidden]) {
-        [[self.controlsBar bottomBarView] setHidden: YES];
-        self.videoViewBottomConstraint.priority = 1;
+        [self hideControlsBar];
     }
 
     [self setMovableByWindowBackground: NO];
@@ -755,8 +766,7 @@
     }
 
     if (![_videoView isHidden]) {
-        [[self.controlsBar bottomBarView] setHidden: NO];
-        self.videoViewBottomConstraint.priority = 999;
+        [self showControlsBar];
     }
 
     [self setMovableByWindowBackground: YES];



More information about the vlc-commits mailing list