title: NSApplication sendEvent does not return while in live rezise
body: <p>I have a polling main loop in c++ (opengl game), using code in objC for input and to handle mac specifics.
  I want to continue doing drawing during a resize operation, but my polling stops in 'sendEvent' for a mouse left down message, and does not exit before the mouse is released and the resize finished, and no redraw is made.</p>
  
  <p>[run once per main loop]</p>
  
  <pre><code>int FsPollDeviceC()
  {
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     while(1)
     {
        [pool release];
        pool = [[NSAutoreleasePool alloc] init];
        NSEvent *event;
        event = [NSApp
        nextEventMatchingMask:NSAnyEventMask
        untilDate: [NSDate distantPast]
        inMode: NSDefaultRunLoopMode
        dequeue:YES];
        if(event!=nil)
        {
           [NSApp sendEvent:event];
           [NSApp updateWindows];
        }
        else
        {
           break;
        }
     }
     [pool release];
     return windowclosed==0 ? 1 : 0;
  } 
  </code></pre>
  
  <p>Code <a href="https://sourceforge.net/p/galaxyv2/code/HEAD/tree/ext_include/mac/fsmacosxwrapper.m" rel="nofollow">https://sourceforge.net/p/galaxyv2/code/HEAD/tree/ext_include/mac/fsmacosxwrapper.m</a> [row 1147]
  Based on FsSimpleWindow (<a href="http://ysflight.in.coocan.jp/programming/fssimplewindow/e.html" rel="nofollow">http://ysflight.in.coocan.jp/programming/fssimplewindow/e.html</a>) but extended.</p>
  
  <p>The entire project source is at <a href="https://sourceforge.net/projects/galaxyv2/files/galaxyv2/galaxyv2_1.81/" rel="nofollow">https://sourceforge.net/projects/galaxyv2/files/galaxyv2/galaxyv2_1.81/</a></p>