Commit 8005efa8 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

macosx: Make sure we animate the embedded window in a non blocking way.

parent 25768ec5
......@@ -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
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