Commit e5267d38 authored by David Fuhrmann's avatar David Fuhrmann
Browse files

macosx: use custom animation for native fullscreen to continue video in animation

close #6347
parent 90ff214a
...@@ -110,6 +110,8 @@ static const float f_min_video_height = 70.0; ...@@ -110,6 +110,8 @@ static const float f_min_video_height = 70.0;
// true when the window is in transition for entering or exiting fullscreen // true when the window is in transition for entering or exiting fullscreen
BOOL b_in_fullscreen_transition; BOOL b_in_fullscreen_transition;
NSRect frameBeforeLionFullscreen;
} }
@property (nonatomic, assign) VLCVoutView* videoView; @property (nonatomic, assign) VLCVoutView* videoView;
......
...@@ -625,6 +625,48 @@ ...@@ -625,6 +625,48 @@
[[[VLCMainWindow sharedInstance] fsPanel] setNonActive:nil]; [[[VLCMainWindow sharedInstance] fsPanel] setNonActive:nil];
} }
-(NSArray*)customWindowsToEnterFullScreenForWindow:(NSWindow *)window
{
if (window == self) {
return [NSArray arrayWithObject:window];
}
return nil;
}
- (NSArray*)customWindowsToExitFullScreenForWindow:(NSWindow*)window
{
if (window == self) {
return [NSArray arrayWithObject:window];
}
return nil;
}
- (void)window:window startCustomAnimationToEnterFullScreenWithDuration:(NSTimeInterval)duration
{
[window setStyleMask:([window styleMask] | NSFullScreenWindowMask)];
NSScreen *screen = [window screen];
NSRect screenFrame = [screen frame];
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) {
[context setDuration:0.5 * duration];
[[window animator] setFrame:screenFrame display:YES];
} completionHandler:nil];
}
- (void)window:window startCustomAnimationToExitFullScreenWithDuration:(NSTimeInterval)duration
{
[window setStyleMask:([window styleMask] & ~NSFullScreenWindowMask)];
[[window animator] setFrame:frameBeforeLionFullscreen display:YES animate:YES];
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) {
[context setDuration:0.5 * duration];
[[window animator] setFrame:frameBeforeLionFullscreen display:YES animate:YES];
} completionHandler:nil];
}
- (void)windowWillEnterFullScreen:(NSNotification *)notification - (void)windowWillEnterFullScreen:(NSNotification *)notification
{ {
// workaround, see #6668 // workaround, see #6668
...@@ -639,6 +681,8 @@ ...@@ -639,6 +681,8 @@
var_SetBool(pl_Get(VLCIntf), "fullscreen", true); var_SetBool(pl_Get(VLCIntf), "fullscreen", true);
frameBeforeLionFullscreen = [self frame];
if ([self hasActiveVideo]) { if ([self hasActiveVideo]) {
vout_thread_t *p_vout = getVoutForActiveWindow(); vout_thread_t *p_vout = getVoutForActiveWindow();
if (p_vout) { if (p_vout) {
...@@ -665,7 +709,6 @@ ...@@ -665,7 +709,6 @@
if (![o_video_view isHidden]) { if (![o_video_view isHidden]) {
[[o_controls_bar bottomBarView] setHidden: YES]; [[o_controls_bar bottomBarView] setHidden: YES];
} }
[self setMovableByWindowBackground: NO]; [self setMovableByWindowBackground: NO];
} }
......
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