Commit f2092e10 authored by Felix Paul Kühne's avatar 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.
parent 7100a8c8
...@@ -1973,6 +1973,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -1973,6 +1973,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_fullscreen_window setFullscreen: YES]; [o_fullscreen_window setFullscreen: YES];
[o_fullscreen_window setBackgroundColor: [NSColor blackColor]]; [o_fullscreen_window setBackgroundColor: [NSColor blackColor]];
[o_fullscreen_window setCanBecomeKeyWindow: YES]; [o_fullscreen_window setCanBecomeKeyWindow: YES];
[o_fullscreen_window setCanBecomeMainWindow: YES];
if (![o_videoWindow isVisible] || [o_videoWindow alphaValue] == 0.0) if (![o_videoWindow isVisible] || [o_videoWindow alphaValue] == 0.0)
{ {
......
...@@ -76,6 +76,8 @@ ...@@ -76,6 +76,8 @@
{ {
BOOL b_canBecomeKeyWindow; BOOL b_canBecomeKeyWindow;
BOOL b_isset_canBecomeKeyWindow; BOOL b_isset_canBecomeKeyWindow;
BOOL b_canBecomeMainWindow;
BOOL b_isset_canBecomeMainWindow;
BOOL b_isFullscreen; BOOL b_isFullscreen;
NSViewAnimation *animation; NSViewAnimation *animation;
} }
......
...@@ -282,6 +282,7 @@ static NSMutableArray *blackoutWindows = NULL; ...@@ -282,6 +282,7 @@ static NSMutableArray *blackoutWindows = NULL;
} }
return self; return self;
} }
- (void)setCanBecomeKeyWindow: (BOOL)canBecomeKey - (void)setCanBecomeKeyWindow: (BOOL)canBecomeKey
{ {
b_isset_canBecomeKeyWindow = YES; b_isset_canBecomeKeyWindow = YES;
...@@ -296,6 +297,20 @@ static NSMutableArray *blackoutWindows = NULL; ...@@ -296,6 +297,20 @@ static NSMutableArray *blackoutWindows = NULL;
return [super canBecomeKeyWindow]; 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 - (void)closeAndAnimate: (BOOL)animate
{ {
NSInvocation *invoc; NSInvocation *invoc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment