]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/evtloop.mm
merging back XTI branch part 2
[wxWidgets.git] / src / osx / cocoa / evtloop.mm
index 11e9d211296b72c4fbe181d032fd90410ddfb787..89957cd2bd7672e073352c8ef469c97c107777e1 100644 (file)
@@ -179,6 +179,16 @@ void wxGUIEventLoop::DoRun()
 void wxGUIEventLoop::DoStop()
 {
     [NSApp stop:0];
 void wxGUIEventLoop::DoStop()
 {
     [NSApp stop:0];
+    // only calling stop: is not enough when called from a runloop-observer,
+    // therefore add a dummy event, to make sure the runloop gets another round
+    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];
 }
 
 CFRunLoopRef wxGUIEventLoop::CFGetCurrentRunLoop() const
 }
 
 CFRunLoopRef wxGUIEventLoop::CFGetCurrentRunLoop() const