Commit dd6454da authored by David Fuhrmann's avatar David Fuhrmann

macosx: exit the native fullscreen mode if video is finished

This implements the behaviour in a similar way as in non-native mode.
Only if the window was set to fullscreen already before video started,
it will stay in this state.
parent 1e3cdead
......@@ -237,9 +237,17 @@
// prevent visible extra window if in fullscreen
NSDisableScreenUpdates();
if (![[VLCMainWindow sharedInstance] nativeFullscreenMode] &&
([o_window fullscreen] || [o_window inFullscreenTransition]))
[o_window leaveFullscreenWithAnimation: NO];
BOOL b_native = [[VLCMainWindow sharedInstance] nativeFullscreenMode];
// close fullscreen, without changing fullscreen vars
if (!b_native && ([o_window fullscreen] || [o_window inFullscreenTransition]))
[o_window leaveFullscreenWithAnimation:NO];
// native fullscreen window will not be closed if
// fullscreen was triggered without video
if ((b_native && [o_window class] == [VLCMainWindow class] && [o_window fullscreen] && [o_window windowShouldExitFullscreenWhenFinished])) {
[o_window toggleFullScreen:self];
}
[[o_window videoView] releaseVoutThread];
......
......@@ -110,11 +110,14 @@ static const float f_min_video_height = 70.0;
BOOL b_in_fullscreen_transition;
NSRect frameBeforeLionFullscreen;
BOOL b_windowShouldExitFullscreenWhenFinished;
}
@property (nonatomic, assign) VLCVoutView* videoView;
@property (readonly) VLCControlsBarCommon* controlsBar;
@property (readonly) BOOL inFullscreenTransition;
@property (readonly) BOOL windowShouldExitFullscreenWhenFinished;
- (void)setWindowLevel:(NSInteger)i_state;
......
......@@ -288,6 +288,7 @@
@synthesize videoView=o_video_view;
@synthesize controlsBar=o_controls_bar;
@synthesize inFullscreenTransition=b_in_fullscreen_transition;
@synthesize windowShouldExitFullscreenWhenFinished=b_windowShouldExitFullscreenWhenFinished;
#pragma mark -
#pragma mark Init
......@@ -713,6 +714,8 @@
[NSApp setPresentationOptions:(NSApplicationPresentationFullScreen | NSApplicationPresentationAutoHideDock | NSApplicationPresentationAutoHideMenuBar)];
i_originalLevel = [self level];
b_windowShouldExitFullscreenWhenFinished = [[VLCMain sharedInstance] activeVideoPlayback];
// b_fullscreen and b_in_fullscreen_transition must not be true yet
[[[VLCMain sharedInstance] voutController] updateWindowLevelForHelperWindows: NSNormalWindowLevel];
[self setLevel:NSNormalWindowLevel];
......
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