[vlc-commits] macosx: make sure that the fullscreen window is the main window ( close #6850)

Felix Paul Kühne git at videolan.org
Mon May 21 11:41:53 CEST 2012


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Mon May 21 11:41:31 2012 +0200| [f2092e1069a7bd65b7a8a99f4da513d06b352d5a] | committer: Felix Paul Kühne

macosx: make sure that the fullscreen window is the main window (close #6850)

With the previous impementation, VLCMainWindow will stay the main window in fullscreen and is accidently activated when closing utility panels.

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

 modules/gui/macosx/MainWindow.m |    1 +
 modules/gui/macosx/misc.h       |    2 ++
 modules/gui/macosx/misc.m       |   15 +++++++++++++++
 3 files changed, 18 insertions(+)

diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index b8bf392..59547d4 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -1973,6 +1973,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
         [o_fullscreen_window setFullscreen: YES];
         [o_fullscreen_window setBackgroundColor: [NSColor blackColor]];
         [o_fullscreen_window setCanBecomeKeyWindow: YES];
+        [o_fullscreen_window setCanBecomeMainWindow: YES];
 
         if (![o_videoWindow isVisible] || [o_videoWindow alphaValue] == 0.0)
         {
diff --git a/modules/gui/macosx/misc.h b/modules/gui/macosx/misc.h
index 1703927..a89bf6e 100644
--- a/modules/gui/macosx/misc.h
+++ b/modules/gui/macosx/misc.h
@@ -76,6 +76,8 @@
 {
     BOOL b_canBecomeKeyWindow;
     BOOL b_isset_canBecomeKeyWindow;
+    BOOL b_canBecomeMainWindow;
+    BOOL b_isset_canBecomeMainWindow;
     BOOL b_isFullscreen;
     NSViewAnimation *animation;
 }
diff --git a/modules/gui/macosx/misc.m b/modules/gui/macosx/misc.m
index fd4868a..1728dbc 100644
--- a/modules/gui/macosx/misc.m
+++ b/modules/gui/macosx/misc.m
@@ -282,6 +282,7 @@ static NSMutableArray *blackoutWindows = NULL;
     }
     return self;
 }
+
 - (void)setCanBecomeKeyWindow: (BOOL)canBecomeKey
 {
     b_isset_canBecomeKeyWindow = YES;
@@ -296,6 +297,20 @@ static NSMutableArray *blackoutWindows = NULL;
     return [super canBecomeKeyWindow];
 }
 
+- (void)setCanBecomeMainWindow: (BOOL)canBecomeMain
+{
+    b_isset_canBecomeMainWindow = YES;
+    b_canBecomeMainWindow = canBecomeMain;
+}
+
+- (BOOL)canBecomeMainWindow
+{
+    if(b_isset_canBecomeMainWindow)
+        return b_canBecomeMainWindow;
+
+    return [super canBecomeMainWindow];
+}
+
 - (void)closeAndAnimate: (BOOL)animate
 {
     NSInvocation *invoc;



More information about the vlc-commits mailing list