[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:42:53 CEST 2012


vlc/vlc-2.0 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Mon May 21 11:41:31 2012 +0200| [4a354598ff3230cd82d51ed154133e51d458c100] | 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.
(cherry picked from commit f2092e1069a7bd65b7a8a99f4da513d06b352d5a)

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

 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 02391dc..0dd9260 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -1721,6 +1721,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 91a8351..cf9f384 100644
--- a/modules/gui/macosx/misc.h
+++ b/modules/gui/macosx/misc.h
@@ -60,6 +60,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 6bcc488..09018be 100644
--- a/modules/gui/macosx/misc.m
+++ b/modules/gui/macosx/misc.m
@@ -188,6 +188,7 @@ static NSMutableArray *blackoutWindows = NULL;
     }
     return self;
 }
+
 - (void)setCanBecomeKeyWindow: (BOOL)canBecomeKey
 {
     b_isset_canBecomeKeyWindow = YES;
@@ -202,6 +203,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