[vlc-commits] macosx: Use floating window level for effects and other panels
David Fuhrmann
git at videolan.org
Mon Sep 8 21:36:21 CEST 2014
vlc/vlc-2.2 | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Sun Aug 31 20:51:36 2014 +0200| [950f5f6748fc45afd82ac172f40d60d4bc51db66] | committer: 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: David Fuhrmann <dfuhrmann at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=950f5f6748fc45afd82ac172f40d60d4bc51db66
---
modules/gui/macosx/AudioEffects.m | 2 +-
modules/gui/macosx/MainMenu.m | 2 +-
modules/gui/macosx/TrackSynchronization.m | 2 +-
modules/gui/macosx/VLCVoutWindowController.h | 4 +++-
modules/gui/macosx/VLCVoutWindowController.m | 19 +++++++++++++------
modules/gui/macosx/VideoEffects.m | 2 +-
modules/gui/macosx/bookmarks.m | 2 +-
modules/gui/macosx/playlistinfo.m | 2 +-
8 files changed, 22 insertions(+), 13 deletions(-)
diff --git a/modules/gui/macosx/AudioEffects.m b/modules/gui/macosx/AudioEffects.m
index 7e24daf..0a77f55 100644
--- a/modules/gui/macosx/AudioEffects.m
+++ b/modules/gui/macosx/AudioEffects.m
@@ -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];
}
}
diff --git a/modules/gui/macosx/MainMenu.m b/modules/gui/macosx/MainMenu.m
index bfbd112..117bf4f 100644
--- a/modules/gui/macosx/MainMenu.m
+++ b/modules/gui/macosx/MainMenu.m
@@ -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];
}
diff --git a/modules/gui/macosx/TrackSynchronization.m b/modules/gui/macosx/TrackSynchronization.m
index f65e5ce..d2deecd 100644
--- a/modules/gui/macosx/TrackSynchronization.m
+++ b/modules/gui/macosx/TrackSynchronization.m
@@ -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];
}
}
diff --git a/modules/gui/macosx/VLCVoutWindowController.h b/modules/gui/macosx/VLCVoutWindowController.h
index c555b73..c6a61dd 100644
--- a/modules/gui/macosx/VLCVoutWindowController.h
+++ b/modules/gui/macosx/VLCVoutWindowController.h
@@ -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;
}
- at property (readonly, nonatomic) NSInteger currentWindowLevel;
+ at property (readonly, nonatomic) NSInteger currentStatusWindowLevel;
+
- (VLCVoutView *)setupVoutForWindow:(vout_window_t *)p_wnd withProposedVideoViewPosition:(NSRect)videoViewPosition;
- (void)removeVoutforDisplay:(NSValue *)o_key;
diff --git a/modules/gui/macosx/VLCVoutWindowController.m b/modules/gui/macosx/VLCVoutWindowController.m
index 305b6eb..99b2192 100644
--- a/modules/gui/macosx/VLCVoutWindowController.m
+++ b/modules/gui/macosx/VLCVoutWindowController.m
@@ -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];
}
- at synthesize currentWindowLevel=i_currentWindowLevel;
+ at synthesize currentStatusWindowLevel=i_currentFloatingWindowLevel;
@end
diff --git a/modules/gui/macosx/VideoEffects.m b/modules/gui/macosx/VideoEffects.m
index fe1a246..050ef98 100644
--- a/modules/gui/macosx/VideoEffects.m
+++ b/modules/gui/macosx/VideoEffects.m
@@ -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];
}
}
diff --git a/modules/gui/macosx/bookmarks.m b/modules/gui/macosx/bookmarks.m
index b593434..a322cdd 100644
--- a/modules/gui/macosx/bookmarks.m
+++ b/modules/gui/macosx/bookmarks.m
@@ -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];
}
diff --git a/modules/gui/macosx/playlistinfo.m b/modules/gui/macosx/playlistinfo.m
index cebace9..bbf00ba 100644
--- a/modules/gui/macosx/playlistinfo.m
+++ b/modules/gui/macosx/playlistinfo.m
@@ -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];
}
More information about the vlc-commits
mailing list