]> git.sesse.net Git - vlc/commitdiff
macosx: fix float-on-top-behaviour if setting is changed while in fullscreen
authorDavid Fuhrmann <david.fuhrmann@googlemail.com>
Sat, 9 Nov 2013 16:26:46 +0000 (17:26 +0100)
committerDavid Fuhrmann <david.fuhrmann@googlemail.com>
Sun, 10 Nov 2013 11:09:52 +0000 (12:09 +0100)
modules/gui/macosx/VLCVoutWindowController.m
modules/gui/macosx/Windows.m

index 55c177e55bf9f7aaf2ce3b4ee500ac1e16ba471e..67daa6a46e834636da26397bec331037e5bcc770 100644 (file)
 
 - (void)setWindowLevel:(NSInteger)i_level forWindow:(vout_window_t *)p_wnd
 {
+    VLCVideoWindowCommon *o_window = [o_vout_dict objectForKey:[NSValue valueWithPointer:p_wnd]];
+    if (!o_window) {
+        msg_Err(VLCIntf, "Cannot set level for nonexisting window");
+        return;
+    }
+
     // only set level for helper windows to normal if no status vout window exist anymore
     if(i_level == NSStatusWindowLevel) {
         i_statusLevelWindowCounter++;
-        [self updateWindowLevelForHelperWindows:i_level];
+        // window level need to stay on normal in fullscreen mode
+        if (![o_window fullscreen])
+            [self updateWindowLevelForHelperWindows:i_level];
     } else {
         if (i_statusLevelWindowCounter > 0)
             i_statusLevelWindowCounter--;
         }
     }
 
-    VLCVideoWindowCommon *o_window = [o_vout_dict objectForKey:[NSValue valueWithPointer:p_wnd]];
-    if (!o_window) {
-        msg_Err(VLCIntf, "Cannot set size for nonexisting window");
-        return;
-    }
-
     [o_window setWindowLevel:i_level];
 }
 
-
 - (void)setFullscreen:(int)i_full forWindow:(vout_window_t *)p_wnd
 {
     intf_thread_t *p_intf = VLCIntf;
index a9fa222f7acd5a886a9e27ef8dc8804935a77869..f71799e7578b879a97615cf92d09239ea1ecd545 100644 (file)
     if (var_InheritBool(VLCIntf, "video-wallpaper") || [self level] < NSNormalWindowLevel)
         return;
 
-    [self setLevel: i_state];
-
+    if (!b_fullscreen)
+        [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;
+    }
 }
 
 - (NSRect)getWindowRectForProposedVideoViewSize:(NSSize)size
         [[VLCMainWindow sharedInstance] recreateHideMouseTimer];
 
     i_originalLevel = [self level];
+    // b_fullscreen must not be true yet
     [[[VLCMain sharedInstance] voutController] updateWindowLevelForHelperWindows: NSNormalWindowLevel];
     [self setLevel:NSNormalWindowLevel];
 
 
     /* Make sure we don't see the window flashes in float-on-top mode */
     i_originalLevel = [self level];
+    // b_fullscreen must not be true yet
     [[[VLCMain sharedInstance] voutController] updateWindowLevelForHelperWindows: NSNormalWindowLevel];
     [self setLevel:NSNormalWindowLevel];
 
-
     /* Only create the o_fullscreen_window if we are not in the middle of the zooming animation */
     if (!o_fullscreen_window) {
         /* We can't change the styleMask of an already created NSWindow, so we create another window, and do eye catching stuff */
 
     [[[VLCMain sharedInstance] voutController] updateWindowLevelForHelperWindows: i_originalLevel];
     [self setLevel:i_originalLevel];
+
     [self setAlphaValue: config_GetFloat(VLCIntf, "macosx-opaqueness")];
 
     // if we quit fullscreen because there is no video anymore, make sure non-embedded window is not visible