]> git.sesse.net Git - vlc/commitdiff
macosx: Use floating window level for effects and other panels
authorDavid Fuhrmann <dfuhrmann@videolan.org>
Sun, 31 Aug 2014 18:51:36 +0000 (20:51 +0200)
committerDavid Fuhrmann <dfuhrmann@videolan.org>
Sun, 31 Aug 2014 18:58:05 +0000 (20:58 +0200)
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

modules/gui/macosx/AudioEffects.m
modules/gui/macosx/MainMenu.m
modules/gui/macosx/TrackSynchronization.m
modules/gui/macosx/VLCVoutWindowController.h
modules/gui/macosx/VLCVoutWindowController.m
modules/gui/macosx/VideoEffects.m
modules/gui/macosx/bookmarks.m
modules/gui/macosx/playlistinfo.m

index f737de06e9a4da6dc67ca5ca301f2332c88cf6d9..745d6dfa318f5c911d56ed41455a8251789f4f2b 100644 (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];
     }
 }
index 9faa83fafb7263ff85a8b9191f73ce925029524b..5f84d1712df633ca47c636e4b0b31f84cb14bb0b 100644 (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];
 }
 
index f65e5ce7a9562dd9b95eb1a215e73d85ac6f0d48..d2deecdcf8ac7b43f2da7ee38dd8617101d8de51 100644 (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];
     }
 }
index c555b73e78bd6241786a7a96508b2b94410dbf94..c6a61dd32e931e9e16d16548f66c6b5e4639e899 100644 (file)
     // 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;
index 305b6ebf407ba4187d02ff96d8ecf27dfe88a483..99b2192dde7b16145940bdf11dfedc46230fb083 100644 (file)
@@ -41,6 +41,7 @@
     self = [super init];
     o_vout_dict = [[NSMutableDictionary alloc] init];
     i_currentWindowLevel = NSNormalWindowLevel;
+    i_currentFloatingWindowLevel = NSFloatingWindowLevel;
     return self;
 }
 
         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
index fe1a2462d37b2297405c897ab0c0f72651e09c11..050ef98a767148987f4a017cf61c690726622717 100644 (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];
     }
 }
index b59343402a185363ed5e5e70ea5b4354f46de060..a322cdda2cc9a3066161b9cb55cb56f67d7555bd 100644 (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];
 }
 
index 40bb85f8dd6aa62fdf1a1e5a1f0689e8736692a7..0e2cd2fbefba4cf76b9497c17359fe8c775f0be9 100644 (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];
 }