[vlc-commits] macOS: Set correct fullscreen window level

Andreas Mieke git at videolan.org
Wed May 3 17:31:20 CEST 2017


vlc | branch: master | Andreas Mieke <andreas at 1750studios.com> | Tue May  2 21:15:00 2017 +0200| [6aa13aa2e52633e453ddae2e6c09a3c3c4d94e0a] | committer: Jean-Baptiste Kempf

macOS: Set correct fullscreen window level

Setting the correct fullscreen window level to hide menu bar
when other apps are active, according to
https://developer.apple.com/library/content/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_fullscreen/opengl_cgl.html

Fix #18117

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/gui/macosx/VLCVoutWindowController.m |  1 +
 modules/gui/macosx/Windows.m                 | 11 +++++------
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/gui/macosx/VLCVoutWindowController.m b/modules/gui/macosx/VLCVoutWindowController.m
index eaf17abf7f..a0aaa18b3f 100644
--- a/modules/gui/macosx/VLCVoutWindowController.m
+++ b/modules/gui/macosx/VLCVoutWindowController.m
@@ -597,6 +597,7 @@ void WindowClose(vout_window_t *p_wnd)
     [[main bookmarks] updateCocoaWindowLevel:currentStatusWindowLevel];
     [[main trackSyncPanel] updateCocoaWindowLevel:currentStatusWindowLevel];
     [[main resumeDialog] updateCocoaWindowLevel:currentStatusWindowLevel];
+    [[[[[VLCMain sharedInstance] mainWindow] fspanel] window] setLevel:currentStatusWindowLevel];
 }
 
 @end
diff --git a/modules/gui/macosx/Windows.m b/modules/gui/macosx/Windows.m
index 1e4e982371..4a037168b0 100644
--- a/modules/gui/macosx/Windows.m
+++ b/modules/gui/macosx/Windows.m
@@ -661,8 +661,8 @@
 
     NSInteger i_currLevel = [self level];
     // self.fullscreen and _inFullscreenTransition must not be true yet
-    [[[VLCMain sharedInstance] voutController] updateWindowLevelForHelperWindows: NSNormalWindowLevel];
-    [self setLevel:NSNormalWindowLevel];
+    [[[VLCMain sharedInstance] voutController] updateWindowLevelForHelperWindows: NSMainMenuWindowLevel + 1];
+    [self setLevel:NSMainMenuWindowLevel + 1];
     i_originalLevel = i_currLevel;
 
     _inFullscreenTransition = YES;
@@ -815,8 +815,8 @@
     /* Make sure we don't see the window flashes in float-on-top mode */
     NSInteger i_currLevel = [self level];
     // self.fullscreen must not be true yet
-    [[[VLCMain sharedInstance] voutController] updateWindowLevelForHelperWindows: NSNormalWindowLevel];
-    [self setLevel:NSNormalWindowLevel];
+    [[[VLCMain sharedInstance] voutController] updateWindowLevelForHelperWindows: NSMainMenuWindowLevel + 1];
+    [self setLevel:NSMainMenuWindowLevel + 1];
     i_originalLevel = i_currLevel; // would be overwritten by previous call
 
     /* Only create the o_fullscreen_window if we are not in the middle of the zooming animation */
@@ -832,6 +832,7 @@
         [o_fullscreen_window setCanBecomeMainWindow: YES];
         [o_fullscreen_window setHasActiveVideo: YES];
         [o_fullscreen_window setFullscreen: YES];
+        [o_fullscreen_window setLevel:NSMainMenuWindowLevel + 1];
 
         /* Make sure video view gets visible in case the playlist was visible before */
         b_video_view_was_hidden = [_videoView isHidden];
@@ -862,8 +863,6 @@
 
             [o_fullscreen_window orderFront:self animate:YES];
 
-            [o_fullscreen_window setLevel:NSNormalWindowLevel];
-
             if (blackout_other_displays) {
                 CGDisplayFade(token, 0.3, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0, 0, 0, NO);
                 CGReleaseDisplayFadeReservation(token);



More information about the vlc-commits mailing list