]> git.saurik.com Git - wxWidgets.git/commitdiff
adding a app-defined event seems to quit inner eventloops like eg the popup of the...
authorStefan Csomor <csomor@advancedconcepts.ch>
Sat, 25 Feb 2012 18:30:04 +0000 (18:30 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sat, 25 Feb 2012 18:30:04 +0000 (18:30 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70684 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/cocoa/evtloop.mm

index 61de0c4ba41924024c7eb711663c232c898dcac9..0228697ebd32f283295142ba4e2a47abe20b5ee5 100644 (file)
@@ -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