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

David Fuhrmann git at videolan.org
Tue Jul 24 12:44:23 CEST 2012


vlc | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Tue Jul 24 12:29:03 2012 +0200| [7f48cb43002663d67614c08315705c3e1ff5b66e] | committer: David Fuhrmann

macosx: display preferences windows on a level >= video window

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7f48cb43002663d67614c08315705c3e1ff5b66e
---

 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 |    1 +
 modules/gui/macosx/simple_prefs.m |    8 +++++++-
 6 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/modules/gui/macosx/MainMenu.m b/modules/gui/macosx/MainMenu.m
index f910708..5baf6dd 100644
--- a/modules/gui/macosx/MainMenu.m
+++ b/modules/gui/macosx/MainMenu.m
@@ -855,7 +855,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 c3addb5..1b9cbf7 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -1859,6 +1859,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 3ef939f..ae4812b 100644
--- a/modules/gui/macosx/prefs.m
+++ b/modules/gui/macosx/prefs.m
@@ -195,8 +195,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 20b6161..1b59f9c 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
diff --git a/modules/gui/macosx/simple_prefs.m b/modules/gui/macosx/simple_prefs.m
index 414815e..a5ac282 100644
--- a/modules/gui/macosx/simple_prefs.m
+++ b/modules/gui/macosx/simple_prefs.m
@@ -740,6 +740,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 )
@@ -762,7 +768,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