From f6c636aeaff535dcab1e8e99e7c40eca874ec6bf Mon Sep 17 00:00:00 2001 From: David Fuhrmann <david.fuhrmann@googlemail.com> Date: Thu, 6 Jun 2013 21:05:55 +0200 Subject: [PATCH] macosx: move fullscreen-related method to VideoWindowCommon class No functional changes, code is still inactive --- modules/gui/macosx/MainWindow.m | 34 ----------------------- modules/gui/macosx/Windows.m | 49 +++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 34 deletions(-) diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m index a3f2cfece5e5..63b7bb8eaf1e 100644 --- a/modules/gui/macosx/MainWindow.m +++ b/modules/gui/macosx/MainWindow.m @@ -813,40 +813,6 @@ static VLCMainWindow *_o_sharedInstance = nil; } -- (void)makeKeyAndOrderFront: (id)sender -{ - /* Hack - * when we exit fullscreen and fade out, we may endup in - * having a window that is faded. We can't have it fade in unless we - * animate again. */ - - if (!b_window_is_invisible) { - /* Make sure we don't do it too much */ - [super makeKeyAndOrderFront: sender]; - return; - } - - [super setAlphaValue:0.0f]; - [super makeKeyAndOrderFront: sender]; - - NSMutableDictionary * dict = [[NSMutableDictionary alloc] initWithCapacity:2]; - [dict setObject:self forKey:NSViewAnimationTargetKey]; - [dict setObject:NSViewAnimationFadeInEffect forKey:NSViewAnimationEffectKey]; - - o_makekey_anim = [[NSViewAnimation alloc] initWithViewAnimations:@[dict]]; - [dict release]; - - [o_makekey_anim setAnimationBlockingMode: NSAnimationNonblocking]; - [o_makekey_anim setDuration: 0.1]; - [o_makekey_anim setFrameRate: 30]; - [o_makekey_anim setDelegate: self]; - - [o_makekey_anim startAnimation]; - b_window_is_invisible = NO; - - /* fullscreenAnimation will be unlocked when animation ends */ -} - #pragma mark - #pragma mark split view delegate - (CGFloat)splitView:(NSSplitView *)splitView constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)dividerIndex diff --git a/modules/gui/macosx/Windows.m b/modules/gui/macosx/Windows.m index 2b50dad6e3f0..a2845f5feaf1 100644 --- a/modules/gui/macosx/Windows.m +++ b/modules/gui/macosx/Windows.m @@ -1049,6 +1049,55 @@ [self hasBecomeFullscreen]; } +- (void)orderOut:(id)sender +{ + [super orderOut:sender]; + + /* + * TODO reimplement leaveFullscreenAndFadeOut:YES, or remove code + * and the hack below + + if (![NSStringFromClass([self class]) isEqualToString:@"VLCMainWindow"]) { + [self leaveFullscreenAndFadeOut:YES]; + } + */ +} + +- (void)makeKeyAndOrderFront: (id)sender +{ + /* Hack + * when we exit fullscreen and fade out, we may endup in + * having a window that is faded. We can't have it fade in unless we + * animate again. */ + + if (!b_window_is_invisible) { + /* Make sure we don't do it too much */ + [super makeKeyAndOrderFront: sender]; + return; + } + + [super setAlphaValue:0.0f]; + [super makeKeyAndOrderFront: sender]; + + NSMutableDictionary * dict = [[NSMutableDictionary alloc] initWithCapacity:2]; + [dict setObject:self forKey:NSViewAnimationTargetKey]; + [dict setObject:NSViewAnimationFadeInEffect forKey:NSViewAnimationEffectKey]; + + o_makekey_anim = [[NSViewAnimation alloc] initWithViewAnimations:@[dict]]; + [dict release]; + + [o_makekey_anim setAnimationBlockingMode: NSAnimationNonblocking]; + [o_makekey_anim setDuration: 0.1]; + [o_makekey_anim setFrameRate: 30]; + [o_makekey_anim setDelegate: self]; + + [o_makekey_anim startAnimation]; + b_window_is_invisible = NO; + + /* fullscreenAnimation will be unlocked when animation ends */ +} + + #pragma mark - #pragma mark Accessibility stuff -- GitLab