]> git.sesse.net Git - vlc/commitdiff
macosx: fix float-on-top behaviour with fullscreen
authorDavid Fuhrmann <david.fuhrmann@googlemail.com>
Sun, 10 Nov 2013 14:25:01 +0000 (15:25 +0100)
committerDavid Fuhrmann <david.fuhrmann@googlemail.com>
Sun, 10 Nov 2013 14:33:51 +0000 (15:33 +0100)
The issues were mostly noticable if you select both float-on-top
and fullscreen in video prefs.

modules/gui/macosx/VLCVoutWindowController.m
modules/gui/macosx/Windows.m

index 67daa6a46e834636da26397bec331037e5bcc770..fb934b80f74e761b8e88146644f2f946615168a2 100644 (file)
     if(i_level == NSStatusWindowLevel) {
         i_statusLevelWindowCounter++;
         // window level need to stay on normal in fullscreen mode
-        if (![o_window fullscreen])
+        if (![o_window fullscreen] && ![o_window enteringFullscreenTransition])
             [self updateWindowLevelForHelperWindows:i_level];
     } else {
         if (i_statusLevelWindowCounter > 0)
index f71799e7578b879a97615cf92d09239ea1ecd545..032ac24ae73c383c4ed3b45df92f5446299d38e0 100644 (file)
     if (var_InheritBool(VLCIntf, "video-wallpaper") || [self level] < NSNormalWindowLevel)
         return;
 
-    if (!b_fullscreen)
+    if (!b_fullscreen && !b_entering_fullscreen_transition)
         [self setLevel: i_state];
     else {
         // only save it for restore
-        // TODO this does not handle the case when level is
-        // changed in the middle of a fullscreen animation
         i_originalLevel = i_state;
     }
 }
     // workaround, see #6668
     [NSApp setPresentationOptions:(NSApplicationPresentationFullScreen | NSApplicationPresentationAutoHideDock | NSApplicationPresentationAutoHideMenuBar)];
 
+    i_originalLevel = [self level];
+    // b_fullscreen and b_entering_fullscreen_transition must not be true yet
+    [[[VLCMain sharedInstance] voutController] updateWindowLevelForHelperWindows: NSNormalWindowLevel];
+    [self setLevel:NSNormalWindowLevel];
+
     b_entering_fullscreen_transition = YES;
 
     var_SetBool(pl_Get(VLCIntf), "fullscreen", true);
     if ([self hasActiveVideo])
         [[VLCMainWindow sharedInstance] recreateHideMouseTimer];
 
-    i_originalLevel = [self level];
-    // b_fullscreen must not be true yet
-    [[[VLCMain sharedInstance] voutController] updateWindowLevelForHelperWindows: NSNormalWindowLevel];
-    [self setLevel:NSNormalWindowLevel];
-
     if (b_dark_interface) {
         [o_titlebar_view removeFromSuperviewWithoutNeedingDisplay];
 
 
     [o_fullscreen_anim1 startAnimation];
     /* fullscreenAnimation will be unlocked when animation ends */
+
+    b_entering_fullscreen_transition = YES;
 }
 
 - (void)hasBecomeFullscreen
     if ([self isVisible])
         [self orderOut: self];
 
+    b_entering_fullscreen_transition = NO;
     [self setFullscreen:YES];
 }