X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f834239f597f81f9fdb979557d7cd22c7684853f..29c829ba84c29a33f5fac69de94513bc174e35c2:/src/osx/cocoa/evtloop.mm diff --git a/src/osx/cocoa/evtloop.mm b/src/osx/cocoa/evtloop.mm index 61de0c4ba4..0228697ebd 100644 --- a/src/osx/cocoa/evtloop.mm +++ b/src/osx/cocoa/evtloop.mm @@ -143,6 +143,7 @@ bool wxGUIEventLoop::Pending() const #endif } + bool wxGUIEventLoop::Dispatch() { if ( !wxTheApp ) @@ -254,15 +255,25 @@ void wxGUIEventLoop::DoStop() void wxGUIEventLoop::WakeUp() { - wxMacAutoreleasePool autoreleasepool; - NSEvent *event = [NSEvent otherEventWithType:NSApplicationDefined + NSEvent* cevent = [NSApp currentEvent]; + + // when already in a mouse event handler, don't add higher level event + if ( cevent != nil && [cevent type] < NSKeyDown ) + { + wxCFEventLoop::WakeUp(); + } + else + { + wxMacAutoreleasePool autoreleasepool; + NSEvent *event = [NSEvent otherEventWithType:NSApplicationDefined location:NSMakePoint(0.0, 0.0) modifierFlags:0 timestamp:0 windowNumber:0 context:nil subtype:0 data1:0 data2:0]; - [NSApp postEvent:event atStart:FALSE]; + [NSApp postEvent:event atStart:FALSE]; + } } CFRunLoopRef wxGUIEventLoop::CFGetCurrentRunLoop() const