Changeset 8005efa8f987d6786d88f5cf7c31e675f14fef78

Show
Ignore:
Timestamp:
07/25/08 01:47:56 (1 month ago)
Author:
Pierre d'Herbemont <pdherbemont@videolan.org>
git-committer:
Pierre d'Herbemont <pdherbemont@videolan.org> 1216943276 +0200
git-parent:

[25768ec58d736505992cc19a25d09c4897b544af]

git-author:
Pierre d'Herbemont <pdherbemont@videolan.org> 1216943251 +0200
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/gui/macosx/embeddedwindow.m

    r75c8bbc r8005efa  
    602602    struct args { NSRect frame; BOOL display; BOOL animate; } * args = (struct args*)[packedargs bytes]; 
    603603 
    604     [super setFrame: args->frame display: args->display animate:args->animate]; 
     604    if( args->animate ) 
     605    { 
     606        /* Make sure we don't block too long and set up a non blocking animation */ 
     607        NSDictionary * dict = [NSDictionary dictionaryWithObjectsAndKeys: 
     608            self, NSViewAnimationTargetKey, 
     609            [NSValue valueWithRect:[self frame]], NSViewAnimationStartFrameKey, 
     610            [NSValue valueWithRect:args->frame], NSViewAnimationEndFrameKey, nil]; 
     611 
     612        NSViewAnimation * anim = [[NSViewAnimation alloc] initWithViewAnimations:[NSArray arrayWithObjects:dict, nil]]; 
     613 
     614        [anim setAnimationBlockingMode: NSAnimationNonblocking]; 
     615        [anim setDuration: 0.4]; 
     616        [anim setFrameRate: 30]; 
     617        [anim startAnimation]; 
     618    } 
     619    else { 
     620        [super setFrame:args->frame display:args->display animate:args->animate]; 
     621    } 
     622 
    605623} 
    606624@end