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
This commit is contained in:
David Fuhrmann 2014-08-31 20:51:36 +02:00
parent 677511e79b
commit 081cba9ccc
8 changed files with 22 additions and 13 deletions

View File

@ -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];
}
}

View File

@ -1160,7 +1160,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];
}

View File

@ -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];
}
}

View File

@ -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;

View File

@ -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

View File

@ -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];
}
}

View File

@ -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];
}

View File

@ -151,7 +151,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: self];
}