[vlc-commits] macosx: retain window level across a fullscreen session

Felix Paul Kühne git at videolan.org
Tue Aug 9 23:47:43 CEST 2011


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Tue Aug  9 23:47:38 2011 +0200| [dce6109d3e57e2ccef6cd10c97135794a12d92ee] | committer: Felix Paul Kühne

macosx: retain window level across a fullscreen session

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

 modules/gui/macosx/MainWindow.m |   14 +++++++++++++-
 modules/gui/macosx/fspanel.m    |    4 ++--
 modules/gui/macosx/vout.m       |   10 ----------
 3 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index ae2f4f0..cd38998 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -945,7 +945,8 @@ static VLCMainWindow *_o_sharedInstance = nil;
             [o_fullscreen_window makeKeyAndOrderFront:self];
             [o_fullscreen_window orderFront:self animate:YES];
 
-            [o_fullscreen_window setFrame:screen_rect display:YES];
+            [o_fullscreen_window setFrame:screen_rect display:YES animate:YES];
+            [o_fullscreen_window setLevel:NSNormalWindowLevel];
 
             if( blackout_other_displays )
             {
@@ -1034,6 +1035,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
 
     /* tell the fspanel to move itself to front next time it's triggered */
     [o_fspanel setVoutWasUpdated: (int)[[o_fullscreen_window screen] displayID]];
+    [o_fspanel setActive: nil];
 
     if([self isVisible])
         [super orderOut: self];
@@ -1062,6 +1064,16 @@ static VLCMainWindow *_o_sharedInstance = nil;
 
     /* We always try to do so */
     [NSScreen unblackoutScreens];
+    vout_thread_t *p_vout = getVout();
+    if (p_vout)
+    {
+        if( var_GetBool( p_vout, "video-on-top" ) )
+            [self setLevel: NSStatusWindowLevel];
+        else
+            [self setLevel: NSNormalWindowLevel];
+        vlc_object_release( p_vout );
+    }
+    [self makeKeyAndOrderFront: nil];
 
     /* Don't do anything if o_fullscreen_window is already closed */
     if (!o_fullscreen_window)
diff --git a/modules/gui/macosx/fspanel.m b/modules/gui/macosx/fspanel.m
index 003a1e3..b16df3c 100644
--- a/modules/gui/macosx/fspanel.m
+++ b/modules/gui/macosx/fspanel.m
@@ -27,7 +27,7 @@
  *****************************************************************************/
 #import "intf.h"
 #import "CoreInteraction.h"
-#import "vout.h"
+#import "MainWindow.h"
 #import "misc.h"
 #import "fspanel.h"
 
@@ -253,7 +253,7 @@
     if (p_vout)
     {
         if (var_GetBool( p_vout, "fullscreen" ))
-            [[[[VLCCoreInteraction sharedInstance] voutView] window] makeKeyWindow];
+            [[[[VLCMainWindow sharedInstance] videoView] window] makeKeyWindow];
         vlc_object_release( p_vout );
     }
 }
diff --git a/modules/gui/macosx/vout.m b/modules/gui/macosx/vout.m
index df9b41f..42beb51 100644
--- a/modules/gui/macosx/vout.m
+++ b/modules/gui/macosx/vout.m
@@ -152,19 +152,9 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
     [o_view setFrameSize: [self frame].size];
 }
 
-- (void)drawRect:(NSRect)rect
-{
-    /* When there is no subview we draw a black background */
-    [self lockFocus];
-    [[NSColor blackColor] set];
-    NSRectFill(rect);
-    [self unlockFocus];
-}
-
 - (void)closeVout
 {
     /* Make sure we don't see a white flash */
-    [[o_view window] disableScreenUpdatesUntilFlush];
     [o_view removeFromSuperview];
     [o_view release];
     o_view = nil;



More information about the vlc-commits mailing list