Commit 60eba2be authored by David Fuhrmann's avatar David Fuhrmann

macosx: support multiple VLC windows in fullscreen, try to just display fspanel when sensible

This allows main window and video window in fullscreen
Note that still the fspanel is displayed to often.
parent 4fdb3cc9
......@@ -179,6 +179,7 @@
[[VLCMainWindow sharedInstance] setNonembedded:b_nonembedded];
[o_vout_view setVoutThread:(vout_thread_t *)p_wnd->p_parent];
[o_new_video_window setHasActiveVideo: YES];
[o_vout_dict setObject:[o_new_video_window autorelease] forKey:[NSValue valueWithPointer:p_wnd]];
if (b_nonembedded) {
......@@ -200,11 +201,16 @@
if ([[VLCMainWindow sharedInstance] fullscreen] && ![[VLCMainWindow sharedInstance] nativeFullscreenMode])
[o_window leaveFullscreen];
if ([[VLCMainWindow sharedInstance] fullscreen] && [[VLCMainWindow sharedInstance] nativeFullscreenMode])
[o_window toggleFullScreen: self];
if (![NSStringFromClass([o_window class]) isEqualToString:@"VLCMainWindow"]) {
[o_window orderOut:self];
}
[[o_window videoView] releaseVoutThread];
[o_window setHasActiveVideo: NO];
[o_vout_dict removeObjectForKey:o_key];
if ([o_vout_dict count] == 0)
......
......@@ -95,11 +95,12 @@ static const float f_min_video_height = 70.0;
NSRecursiveLock * o_animation_lock;
NSInteger i_originalLevel;
BOOL b_has_active_video;
}
@property (nonatomic, assign) VLCVoutView* videoView;
@property (readonly) VLCControlsBarCommon* controlsBar;
@property (nonatomic, readwrite) BOOL hasActiveVideo;
- (void)setWindowLevel:(NSInteger)i_state;
......
......@@ -239,6 +239,7 @@
@synthesize videoView=o_video_view;
@synthesize controlsBar=o_controls_bar;
@synthesize hasActiveVideo=b_has_active_video;
#pragma mark -
#pragma mark Init
......@@ -551,11 +552,13 @@
var_SetBool(pl_Get(VLCIntf), "fullscreen", true);
if ([self hasActiveVideo]) {
vout_thread_t *p_vout = getVoutForActiveWindow();
if (p_vout) {
var_SetBool(p_vout, "fullscreen", true);
vlc_object_release(p_vout);
}
}
[o_video_view setFrame: [[self contentView] frame]];
[[VLCMainWindow sharedInstance] setFullscreen: YES];
......@@ -576,7 +579,8 @@
[self setFrame: winrect display:NO animate:NO];
}
if ([[VLCMain sharedInstance] activeVideoPlayback])
// TODO fix bottom bar status when vout just not visible, but there
if (![o_video_view isHidden])
[[o_controls_bar bottomBarView] setHidden: YES];
[self setMovableByWindowBackground: NO];
......@@ -588,9 +592,10 @@
// But this creates some problems when leaving fs over remote intfs, so activate app here.
[NSApp activateIgnoringOtherApps:YES];
if ([self hasActiveVideo]) {
[[[VLCMainWindow sharedInstance] fsPanel] setVoutWasUpdated: self];
[[[VLCMainWindow sharedInstance] fsPanel] setActive: nil];
}
NSArray *subviews = [[self videoView] subviews];
NSUInteger count = [subviews count];
......@@ -606,11 +611,13 @@
{
var_SetBool(pl_Get(VLCIntf), "fullscreen", false);
if ([self hasActiveVideo]) {
vout_thread_t *p_vout = getVoutForActiveWindow();
if (p_vout) {
var_SetBool(p_vout, "fullscreen", false);
vlc_object_release(p_vout);
}
}
[NSCursor setHiddenUntilMouseMoves: NO];
[[[VLCMainWindow sharedInstance] fsPanel] setNonActive: nil];
......
......@@ -183,7 +183,13 @@
- (void)setActive:(id)noData
{
b_nonActive = NO;
id currentWindow = [NSApp keyWindow];
if ([currentWindow respondsToSelector:@selector(hasActiveVideo)]) {
if ([currentWindow hasActiveVideo]) {
[[VLCMain sharedInstance] showFullscreenController];
}
}
}
/* This routine is called repeatedly to fade in the window */
......
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