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.
// 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];
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;
@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
[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];