[vlc-commits] macosx: add missing deletate for blackout window hiding animation ( fixes #9106)
David Fuhrmann
git at videolan.org
Tue Aug 6 20:21:17 CEST 2013
vlc/vlc-2.1 | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Tue Aug 6 19:59:05 2013 +0200| [ebe27cdf1bab99a24cecbc28fca79ba3cf6f820f] | committer: David Fuhrmann
macosx: add missing deletate for blackout window hiding animation (fixes #9106)
(cherry picked from commit c8bad3087191f95bfebac1c8ba6ee0cb7c890e97)
Signed-off-by: David Fuhrmann <david.fuhrmann at googlemail.com>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=ebe27cdf1bab99a24cecbc28fca79ba3cf6f820f
---
modules/gui/macosx/Windows.h | 2 +-
modules/gui/macosx/Windows.m | 16 +++++++++++-----
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/modules/gui/macosx/Windows.h b/modules/gui/macosx/Windows.h
index 5a9a053..2dd7ad7 100644
--- a/modules/gui/macosx/Windows.h
+++ b/modules/gui/macosx/Windows.h
@@ -33,7 +33,7 @@
@class VLCVoutView;
- at interface VLCWindow : NSWindow
+ at interface VLCWindow : NSWindow <NSAnimationDelegate>
{
BOOL b_canBecomeKeyWindow;
BOOL b_isset_canBecomeKeyWindow;
diff --git a/modules/gui/macosx/Windows.m b/modules/gui/macosx/Windows.m
index cbc004c..cec3a9e 100644
--- a/modules/gui/macosx/Windows.m
+++ b/modules/gui/macosx/Windows.m
@@ -88,7 +88,9 @@
return;
}
- invoc = [NSInvocation invocationWithMethodSignature:[super methodSignatureForSelector:@selector(close)]];
+ // TODO this callback stuff does not work and is not needed
+ invoc = [[[NSInvocation alloc] init] autorelease];
+ [invoc setSelector:@selector(close)];
[invoc setTarget: self];
if (![self isVisible] || [self alphaValue] == 0.0) {
@@ -101,9 +103,10 @@
- (void)orderOut: (id)sender animate: (BOOL)animate
{
- NSInvocation *invoc = [NSInvocation invocationWithMethodSignature:[super methodSignatureForSelector:@selector(orderOut:)]];
+ NSInvocation *invoc = [[[NSInvocation alloc] init] autorelease];
+ [invoc setSelector:@selector(orderOut:)];
[invoc setTarget: self];
- [invoc setArgument: sender atIndex: 0];
+ [invoc setArgument: sender atIndex: 2];
[self orderOut: sender animate: animate callback: invoc];
}
@@ -129,7 +132,8 @@
[anim setAnimationBlockingMode:NSAnimationNonblocking];
[anim setDuration:0.9];
[anim setFrameRate:30];
- [anim setUserInfo: callback];
+ [anim setUserInfo:callback];
+ [anim setDelegate:self];
@synchronized(self) {
current_anim = self->o_current_animation;
@@ -182,6 +186,7 @@
[anim setAnimationBlockingMode:NSAnimationNonblocking];
[anim setDuration:0.5];
[anim setFrameRate:30];
+ [anim setDelegate:self];
@synchronized(self) {
current_anim = self->o_current_animation;
@@ -209,8 +214,9 @@
NSInvocation * invoc;
[super orderOut: nil];
[self setAlphaValue: 1.0];
- if ((invoc = [anim userInfo]))
+ if ((invoc = [anim userInfo])) {
[invoc invoke];
+ }
}
}
More information about the vlc-commits
mailing list