From: Pierre d'Herbemont Date: Thu, 24 Jul 2008 23:47:31 +0000 (+0200) Subject: macosx: Make sure we animate the embedded window in a non blocking way. X-Git-Tag: 0.9.0-test3~274 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=8005efa8f987d6786d88f5cf7c31e675f14fef78;p=vlc macosx: Make sure we animate the embedded window in a non blocking way. --- diff --git a/modules/gui/macosx/embeddedwindow.m b/modules/gui/macosx/embeddedwindow.m index a4d98e8d7c..03b2aa0e07 100644 --- a/modules/gui/macosx/embeddedwindow.m +++ b/modules/gui/macosx/embeddedwindow.m @@ -601,6 +601,24 @@ { struct args { NSRect frame; BOOL display; BOOL animate; } * args = (struct args*)[packedargs bytes]; - [super setFrame: args->frame display: args->display animate:args->animate]; + if( args->animate ) + { + /* Make sure we don't block too long and set up a non blocking animation */ + NSDictionary * dict = [NSDictionary dictionaryWithObjectsAndKeys: + self, NSViewAnimationTargetKey, + [NSValue valueWithRect:[self frame]], NSViewAnimationStartFrameKey, + [NSValue valueWithRect:args->frame], NSViewAnimationEndFrameKey, nil]; + + NSViewAnimation * anim = [[NSViewAnimation alloc] initWithViewAnimations:[NSArray arrayWithObjects:dict, nil]]; + + [anim setAnimationBlockingMode: NSAnimationNonblocking]; + [anim setDuration: 0.4]; + [anim setFrameRate: 30]; + [anim startAnimation]; + } + else { + [super setFrame:args->frame display:args->display animate:args->animate]; + } + } @end