[vlc-devel] [PATCH 1/5] macosx: make sure that isFullscreen only returns true in an actual fullscreen window

David Fuhrmann david.fuhrmann at googlemail.com
Wed Feb 15 15:14:30 CET 2012


this fixes the issue that nonembedded window was not allowed to resize itself (e.g. after aspect ratio change)
---
 modules/gui/macosx/MainWindow.m |    1 +
 modules/gui/macosx/misc.h       |    3 +++
 modules/gui/macosx/misc.m       |    9 ++++++++-
 3 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index 5c9e4d2..6e6340f 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -1377,6 +1377,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
         rect.origin.x += [[o_video_view window] frame].origin.x;
         rect.origin.y += [[o_video_view window] frame].origin.y;
         o_fullscreen_window = [[VLCWindow alloc] initWithContentRect:rect styleMask: NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES];
+        [o_fullscreen_window setFullscreen: YES];
         [o_fullscreen_window setBackgroundColor: [NSColor blackColor]];
         [o_fullscreen_window setCanBecomeKeyWindow: YES];
 
diff --git a/modules/gui/macosx/misc.h b/modules/gui/macosx/misc.h
index c29b601..d7356d9 100644
--- a/modules/gui/macosx/misc.h
+++ b/modules/gui/macosx/misc.h
@@ -61,6 +61,7 @@
 {
     BOOL b_canBecomeKeyWindow;
     BOOL b_isset_canBecomeKeyWindow;
+    BOOL b_isFullscreen;
     NSViewAnimation *animation;
 }
 
@@ -78,6 +79,8 @@
 /* animate mode is only supported in >=10.4 */
 - (void)closeAndAnimate: (BOOL)animate;
 
+- (void)setFullscreen:(BOOL)b_var;
+
 - (BOOL)isFullscreen;
 @end
 
diff --git a/modules/gui/macosx/misc.m b/modules/gui/macosx/misc.m
index 5bca42c..98dc3ca 100644
--- a/modules/gui/macosx/misc.m
+++ b/modules/gui/macosx/misc.m
@@ -188,6 +188,7 @@ static NSMutableArray *blackoutWindows = NULL;
     self = [super initWithContentRect:contentRect styleMask:styleMask backing:backingType defer:flag];
     if( self )
     {
+        b_isFullscreen = NO;
         b_isset_canBecomeKeyWindow = NO;
         /* we don't want this window to be restored on relaunch */
         if (OSX_LION)
@@ -361,10 +362,16 @@ static NSMutableArray *blackoutWindows = NULL;
     }
 }
 
+- (void)setFullscreen:(BOOL)b_var
+{
+    b_isFullscreen = b_var;
+}
+
 - (BOOL)isFullscreen
 {
-    return YES;
+    return b_isFullscreen;
 }
+
 @end
 
 /*****************************************************************************
-- 
1.7.5.4




More information about the vlc-devel mailing list