Commit 950f5f67 authored by David Fuhrmann's avatar David Fuhrmann

macosx: Use floating window level for effects and other panels

All black-syle panels should get the floating window level.
This is normal behaviour of panels and has the positive side effect
that the panel also stays in front while vout window reconfigurations.

This level is also used for the preferences window, as this is sort
of a modal window which needs to be closed (in order to get settings
saved).

close #12063

(cherry picked from commit 081cba9ccc60b60f5f22a8a5be3895147eb0a709)
Signed-off-by: default avatarDavid Fuhrmann <dfuhrmann@videolan.org>
parent 1ad06aa4
......@@ -209,7 +209,7 @@ static VLCAudioEffects *_o_sharedInstance = nil;
if ([o_window isKeyWindow])
[o_window orderOut:sender];
else {
[o_window setLevel: [[[VLCMain sharedInstance] voutController] currentWindowLevel]];
[o_window setLevel: [[[VLCMain sharedInstance] voutController] currentStatusWindowLevel]];
[o_window makeKeyAndOrderFront:sender];
}
}
......
......@@ -1181,7 +1181,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
- (IBAction)viewPreferences:(id)sender
{
NSInteger i_level = [[[VLCMain sharedInstance] voutController] currentWindowLevel];
NSInteger i_level = [[[VLCMain sharedInstance] voutController] currentStatusWindowLevel];
[[[VLCMain sharedInstance] simplePreferences] showSimplePrefsWithLevel:i_level];
}
......
......@@ -109,7 +109,7 @@ static VLCTrackSynchronization *_o_sharedInstance = nil;
if ([o_window isVisible])
[o_window orderOut:sender];
else {
[o_window setLevel: [[[VLCMain sharedInstance] voutController] currentWindowLevel]];
[o_window setLevel: [[[VLCMain sharedInstance] voutController] currentStatusWindowLevel]];
[o_window makeKeyAndOrderFront:sender];
}
}
......
......@@ -38,11 +38,13 @@
// save the status level if at least one video window is on status level
NSUInteger i_statusLevelWindowCounter;
NSInteger i_currentWindowLevel;
NSInteger i_currentFloatingWindowLevel;
BOOL b_mainwindow_has_video;
}
@property (readonly, nonatomic) NSInteger currentWindowLevel;
@property (readonly, nonatomic) NSInteger currentStatusWindowLevel;
- (VLCVoutView *)setupVoutForWindow:(vout_window_t *)p_wnd withProposedVideoViewPosition:(NSRect)videoViewPosition;
- (void)removeVoutforDisplay:(NSValue *)o_key;
......
......@@ -41,6 +41,7 @@
self = [super init];
o_vout_dict = [[NSMutableDictionary alloc] init];
i_currentWindowLevel = NSNormalWindowLevel;
i_currentFloatingWindowLevel = NSFloatingWindowLevel;
return self;
}
......@@ -397,15 +398,21 @@
return;
i_currentWindowLevel = i_level;
if (i_level == NSNormalWindowLevel) {
i_currentFloatingWindowLevel = NSFloatingWindowLevel;
} else {
i_currentFloatingWindowLevel = i_level + 1;
}
[[VLCMainWindow sharedInstance] setWindowLevel:i_level];
[[VLCVideoEffects sharedInstance] updateCocoaWindowLevel:i_level];
[[VLCAudioEffects sharedInstance] updateCocoaWindowLevel:i_level];
[[[VLCMain sharedInstance] info] updateCocoaWindowLevel:i_level];
[[VLCBookmarks sharedInstance] updateCocoaWindowLevel:i_level];
[[VLCTrackSynchronization sharedInstance] updateCocoaWindowLevel:i_level];
[[VLCVideoEffects sharedInstance] updateCocoaWindowLevel:i_currentFloatingWindowLevel];
[[VLCAudioEffects sharedInstance] updateCocoaWindowLevel:i_currentFloatingWindowLevel];
[[[VLCMain sharedInstance] info] updateCocoaWindowLevel:i_currentFloatingWindowLevel];
[[VLCBookmarks sharedInstance] updateCocoaWindowLevel:i_currentFloatingWindowLevel];
[[VLCTrackSynchronization sharedInstance] updateCocoaWindowLevel:i_currentFloatingWindowLevel];
}
@synthesize currentWindowLevel=i_currentWindowLevel;
@synthesize currentStatusWindowLevel=i_currentFloatingWindowLevel;
@end
......@@ -572,7 +572,7 @@ static VLCVideoEffects *_o_sharedInstance = nil;
if ([o_window isKeyWindow])
[o_window orderOut:sender];
else {
[o_window setLevel: [[[VLCMain sharedInstance] voutController] currentWindowLevel]];
[o_window setLevel: [[[VLCMain sharedInstance] voutController] currentStatusWindowLevel]];
[o_window makeKeyAndOrderFront:sender];
}
}
......
......@@ -124,7 +124,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
{
/* show the window, called from intf.m */
[o_bookmarks_window displayIfNeeded];
[o_bookmarks_window setLevel: [[[VLCMain sharedInstance] voutController] currentWindowLevel]];
[o_bookmarks_window setLevel: [[[VLCMain sharedInstance] voutController] currentStatusWindowLevel]];
[o_bookmarks_window makeKeyAndOrderFront:nil];
}
......
......@@ -149,7 +149,7 @@ static VLCInfo *_o_sharedInstance = nil;
else
[self initMediaPanelStats];
NSInteger i_level = [[[VLCMain sharedInstance] voutController] currentWindowLevel];
NSInteger i_level = [[[VLCMain sharedInstance] voutController] currentStatusWindowLevel];
[o_info_window setLevel: i_level];
[o_info_window makeKeyAndOrderFront:nil];
}
......
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