]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/evtloop.cpp
Fix checking for GTK+ 3.0 in configure.
[wxWidgets.git] / src / osx / carbon / evtloop.cpp
index 255c08f0f2a20df73f7fa19c57bf1288eba6ca2a..288210641b76b1ec33483d866135bfc0a0987fbf 100644 (file)
@@ -83,13 +83,31 @@ int wxGUIEventLoop::DoDispatchTimeout(unsigned long timeout)
     }
 }
 
-void wxGUIEventLoop::DoRun()
+void wxGUIEventLoop::WakeUp()
+{
+    OSStatus err = noErr;
+    wxMacCarbonEvent wakeupEvent;
+    wakeupEvent.Create( 'WXMC', 'WXMC', GetCurrentEventTime(),
+                        kEventAttributeNone );
+    err = PostEventToQueue(GetMainEventQueue(), wakeupEvent,
+                            kEventPriorityHigh );
+}
+
+void wxGUIEventLoop::OSXDoRun()
 {
     wxMacAutoreleasePool autoreleasepool;
-    RunApplicationEventLoop();
+
+    while (!m_shouldExit)
+    {
+        RunApplicationEventLoop();
+    }
+
+    // Force enclosing event loop to temporarily exit and check
+    // if it should be stopped.
+    QuitApplicationEventLoop();
 }
 
-void wxGUIEventLoop::DoStop()
+void wxGUIEventLoop::OSXDoStop()
 {
     QuitApplicationEventLoop();
 }
@@ -117,7 +135,7 @@ wxModalEventLoop::wxModalEventLoop(WXWindow modalNativeWindow)
 
 // END move into a evtloop_osx.cpp
 
-void wxModalEventLoop::DoRun()
+void wxModalEventLoop::OSXDoRun()
 {
     wxWindowDisabler disabler(m_modalWindow);
     wxMacAutoreleasePool autoreleasepool;
@@ -153,7 +171,7 @@ void wxModalEventLoop::DoRun()
 
 }
 
-void wxModalEventLoop::DoStop()
+void wxModalEventLoop::OSXDoStop()
 {
     wxMacAutoreleasePool autoreleasepool;
     QuitAppModalLoopForWindow(m_modalNativeWindow);