vlc | branch: master | David Fuhrmann <david.fuhrm...@googlemail.com> | Sat Feb 15 20:33:27 2014 +0100| [e5267d38f1379979c45b9564c83f056b90e0fd90] | committer: David Fuhrmann
macosx: use custom animation for native fullscreen to continue video in animation close #6347 > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e5267d38f1379979c45b9564c83f056b90e0fd90 --- modules/gui/macosx/Windows.h | 2 ++ modules/gui/macosx/Windows.m | 45 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/modules/gui/macosx/Windows.h b/modules/gui/macosx/Windows.h index db65280..2c4273f 100644 --- a/modules/gui/macosx/Windows.h +++ b/modules/gui/macosx/Windows.h @@ -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 BOOL b_in_fullscreen_transition; + + NSRect frameBeforeLionFullscreen; } @property (nonatomic, assign) VLCVoutView* videoView; diff --git a/modules/gui/macosx/Windows.m b/modules/gui/macosx/Windows.m index 13182ad..c9962d2 100644 --- a/modules/gui/macosx/Windows.m +++ b/modules/gui/macosx/Windows.m @@ -625,6 +625,48 @@ [[[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 { // workaround, see #6668 @@ -639,6 +681,8 @@ var_SetBool(pl_Get(VLCIntf), "fullscreen", true); + frameBeforeLionFullscreen = [self frame]; + if ([self hasActiveVideo]) { vout_thread_t *p_vout = getVoutForActiveWindow(); if (p_vout) { @@ -665,7 +709,6 @@ if (![o_video_view isHidden]) { [[o_controls_bar bottomBarView] setHidden: YES]; } - [self setMovableByWindowBackground: NO]; } _______________________________________________ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits