[vlc-commits] macosx: display preferences windows on a level >= video window

David Fuhrmann git at videolan.org
Sat Jul 28 16:47:09 CEST 2012


vlc/vlc-2.0 | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Tue Jul 24 12:29:03 2012 +0200| [1777f5543d331665bf201957e1df2efb828e5e91] | committer: Felix Paul Kühne

macosx: display preferences windows on a level >= video window
(cherry picked from commit 7f48cb43002663d67614c08315705c3e1ff5b66e)

Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=1777f5543d331665bf201957e1df2efb828e5e91
---

 modules/gui/macosx/MainMenu.m     |    6 +++++-
 modules/gui/macosx/MainWindow.m   |    2 ++
 modules/gui/macosx/prefs.h        |    2 +-
 modules/gui/macosx/prefs.m        |    3 ++-
 modules/gui/macosx/simple_prefs.h |    3 ++-
 modules/gui/macosx/simple_prefs.m |    8 +++++++-
 6 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/modules/gui/macosx/MainMenu.m b/modules/gui/macosx/MainMenu.m
index 5383226..ef134fc 100644
--- a/modules/gui/macosx/MainMenu.m
+++ b/modules/gui/macosx/MainMenu.m
@@ -754,7 +754,11 @@ static VLCMainMenu *_o_sharedInstance = nil;
 
 - (IBAction)viewPreferences:(id)sender
 {
-    [[[VLCMain sharedInstance] simplePreferences] showSimplePrefs];
+    NSInteger i_level = NSNormalWindowLevel;
+    NSInteger i_video_window_level = [[[[VLCMainWindow sharedInstance] videoView] window] level];
+    if( i_video_window_level == NSStatusWindowLevel )
+        i_level = NSStatusWindowLevel;
+    [[[VLCMain sharedInstance] simplePreferences] showSimplePrefsWithLevel:i_level];
 }
 
 #pragma mark -
diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index c694fff..84bb18c 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -1605,6 +1605,8 @@ static VLCMainWindow *_o_sharedInstance = nil;
 
         if( [self level] != NSNormalWindowLevel )
             [self setLevel: NSNormalWindowLevel];
+        if( [o_detached_video_window level] != NSNormalWindowLevel )
+            [o_detached_video_window setLevel: NSNormalWindowLevel];
 
         // restore alpha value to 1 for the case that macosx-opaqueness is set to < 1
         [self setAlphaValue:1.0];
diff --git a/modules/gui/macosx/prefs.h b/modules/gui/macosx/prefs.h
index 2d77d48..698d0fd 100644
--- a/modules/gui/macosx/prefs.h
+++ b/modules/gui/macosx/prefs.h
@@ -47,7 +47,7 @@
 
 - (void)initStrings;
 - (void)setTitle: (NSString *) o_title_name;
-- (void)showPrefs;
+- (void)showPrefsWithLevel:(NSInteger)i_window_level;
 - (IBAction)savePrefs: (id)sender;
 - (IBAction)closePrefs: (id)sender;
 - (IBAction)resetAll: (id)sender;
diff --git a/modules/gui/macosx/prefs.m b/modules/gui/macosx/prefs.m
index 811f4e4..4e842ee 100644
--- a/modules/gui/macosx/prefs.m
+++ b/modules/gui/macosx/prefs.m
@@ -193,8 +193,9 @@ static VLCPrefs *_o_sharedMainInstance = nil;
     [o_title setStringValue: o_title_name];
 }
 
-- (void)showPrefs
+- (void)showPrefsWithLevel:(NSInteger)i_window_level
 {
+    [o_prefs_window setLevel: i_window_level];
     [o_prefs_window center];
     [o_prefs_window makeKeyAndOrderFront:self];
     [_rootTreeItem resetView];
diff --git a/modules/gui/macosx/simple_prefs.h b/modules/gui/macosx/simple_prefs.h
index 61e485b..5c3c6cc 100644
--- a/modules/gui/macosx/simple_prefs.h
+++ b/modules/gui/macosx/simple_prefs.h
@@ -196,6 +196,7 @@ IBOutlet id o_intf_mediakeys_ckb;
 - (void)initStrings;
 - (void)resetControls;
 - (void)showSimplePrefs;
+- (void)showSimplePrefsWithLevel:(NSInteger)i_window_level;
 
 - (IBAction)buttonAction:(id)sender;
 - (void)sheetDidEnd:(NSWindow *)o_sheet 
@@ -241,4 +242,4 @@ IBOutlet id o_intf_mediakeys_ckb;
 
 @interface VLCSimplePrefsWindow : NSWindow
 
- at end
\ No newline at end of file
+ at end
diff --git a/modules/gui/macosx/simple_prefs.m b/modules/gui/macosx/simple_prefs.m
index 56c941e..9f1dc92 100644
--- a/modules/gui/macosx/simple_prefs.m
+++ b/modules/gui/macosx/simple_prefs.m
@@ -738,6 +738,12 @@ static inline char * __config_GetLabel( vlc_object_t *p_this, const char *psz_na
     [o_sprefs_win makeKeyAndOrderFront: self];
 }
 
+- (void)showSimplePrefsWithLevel:(NSInteger)i_window_level
+{
+    [o_sprefs_win setLevel: i_window_level];
+    [self showSimplePrefs];
+}
+
 - (IBAction)buttonAction:(id)sender
 {
     if( sender == o_sprefs_cancel_btn )
@@ -756,7 +762,7 @@ static inline char * __config_GetLabel( vlc_object_t *p_this, const char *psz_na
     else if( sender == o_sprefs_showAll_btn )
     {
         [o_sprefs_win orderOut: self];
-        [[[VLCMain sharedInstance] preferences] showPrefs];
+        [[[VLCMain sharedInstance] preferences] showPrefsWithLevel:[o_sprefs_win level]];
     }
     else
         msg_Warn( p_intf, "unknown buttonAction sender" );



More information about the vlc-commits mailing list