Commit 9dda04b9 authored by David Fuhrmann's avatar David Fuhrmann

macosx: fix float-on-top-behaviour if setting is changed while in fullscreen

parent e062d7c8
...@@ -276,10 +276,18 @@ ...@@ -276,10 +276,18 @@
- (void)setWindowLevel:(NSInteger)i_level forWindow:(vout_window_t *)p_wnd - (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 // only set level for helper windows to normal if no status vout window exist anymore
if(i_level == NSStatusWindowLevel) { if(i_level == NSStatusWindowLevel) {
i_statusLevelWindowCounter++; 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 { } else {
if (i_statusLevelWindowCounter > 0) if (i_statusLevelWindowCounter > 0)
i_statusLevelWindowCounter--; i_statusLevelWindowCounter--;
...@@ -289,16 +297,9 @@ ...@@ -289,16 +297,9 @@
} }
} }
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]; [o_window setWindowLevel:i_level];
} }
- (void)setFullscreen:(int)i_full forWindow:(vout_window_t *)p_wnd - (void)setFullscreen:(int)i_full forWindow:(vout_window_t *)p_wnd
{ {
intf_thread_t *p_intf = VLCIntf; intf_thread_t *p_intf = VLCIntf;
......
...@@ -465,8 +465,14 @@ ...@@ -465,8 +465,14 @@
if (var_InheritBool(VLCIntf, "video-wallpaper") || [self level] < NSNormalWindowLevel) if (var_InheritBool(VLCIntf, "video-wallpaper") || [self level] < NSNormalWindowLevel)
return; 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 - (NSRect)getWindowRectForProposedVideoViewSize:(NSSize)size
...@@ -628,6 +634,7 @@ ...@@ -628,6 +634,7 @@
[[VLCMainWindow sharedInstance] recreateHideMouseTimer]; [[VLCMainWindow sharedInstance] recreateHideMouseTimer];
i_originalLevel = [self level]; i_originalLevel = [self level];
// b_fullscreen must not be true yet
[[[VLCMain sharedInstance] voutController] updateWindowLevelForHelperWindows: NSNormalWindowLevel]; [[[VLCMain sharedInstance] voutController] updateWindowLevelForHelperWindows: NSNormalWindowLevel];
[self setLevel:NSNormalWindowLevel]; [self setLevel:NSNormalWindowLevel];
...@@ -764,10 +771,10 @@ ...@@ -764,10 +771,10 @@
/* Make sure we don't see the window flashes in float-on-top mode */ /* Make sure we don't see the window flashes in float-on-top mode */
i_originalLevel = [self level]; i_originalLevel = [self level];
// b_fullscreen must not be true yet
[[[VLCMain sharedInstance] voutController] updateWindowLevelForHelperWindows: NSNormalWindowLevel]; [[[VLCMain sharedInstance] voutController] updateWindowLevelForHelperWindows: NSNormalWindowLevel];
[self setLevel:NSNormalWindowLevel]; [self setLevel:NSNormalWindowLevel];
/* Only create the o_fullscreen_window if we are not in the middle of the zooming animation */ /* Only create the o_fullscreen_window if we are not in the middle of the zooming animation */
if (!o_fullscreen_window) { 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 */ /* We can't change the styleMask of an already created NSWindow, so we create another window, and do eye catching stuff */
...@@ -1037,6 +1044,7 @@ ...@@ -1037,6 +1044,7 @@
[[[VLCMain sharedInstance] voutController] updateWindowLevelForHelperWindows: i_originalLevel]; [[[VLCMain sharedInstance] voutController] updateWindowLevelForHelperWindows: i_originalLevel];
[self setLevel:i_originalLevel]; [self setLevel:i_originalLevel];
[self setAlphaValue: config_GetFloat(VLCIntf, "macosx-opaqueness")]; [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 // if we quit fullscreen because there is no video anymore, make sure non-embedded window is not visible
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment