title: Why NSAnimationContext completionHandler does not work (sometimes)?
body: <pre><code>
      // wc here is an NSWindowController
  
      [NSAnimationContext beginGrouping];
      [[NSAnimationContext currentContext] setDuration:0.5f];
  
      if (duplication) {
          NSPoint origin = initialSize.origin;
          origin.y += initialSize.size.height;
          origin = [wc.window cascadeTopLeftFromPoint:origin];
          origin.y -= initialSize.size.height;
          //[[wc.window animator] setFrameOrigin:origin];   // Why setFrameOrigin and cascadeTopLeftFromPoint are not animated?
          initialSize.origin = origin;
          [[wc.window animator] setFrame:initialSize display:YES];
      }
  
      // This block should be invoked when all of the animations started above have completed or been cancelled.
      // For not to show the edit window till the duplication animation not finished
      [NSAnimationContext currentContext].completionHandler = ^{
          if (edit)
              [wc editDocument:self];
          else
              if (fullScreen)
                  [wc.window toggleFullScreen:self];
      };
  
      [NSAnimationContext endGrouping];
  </code></pre>
  
  <p>In this case the completion block executed but unfortunately does not wait for the window reposition be finished, instead it opens the window's edit sheet immediately and moves them together.</p>
  
  <p>The most strange thing is that a few lines above in the same source file the same type of completition block works fine :-O</p>
  
  <p>What am I missing here?</p>