]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/evtloop.mm
Fix harmless unused parameter warnings in wxDEBUG_LEVEL==0 build.
[wxWidgets.git] / src / osx / cocoa / evtloop.mm
index bcd24e8405fd41e84156e860d81b92046094a5ae..11e9d211296b72c4fbe181d032fd90410ddfb787 100644 (file)
@@ -118,10 +118,16 @@ bool wxGUIEventLoop::Dispatch()
                 inMode:NSDefaultRunLoopMode
                 dequeue: YES])
     {
+        WXEVENTREF formerEvent = wxTheApp == NULL ? NULL : wxTheApp->MacGetCurrentEvent();
+        WXEVENTHANDLERCALLREF formerHandler = wxTheApp == NULL ? NULL : wxTheApp->MacGetCurrentEventHandlerCallRef();
+
         if (wxTheApp)
             wxTheApp->MacSetCurrentEvent(event, NULL);
         m_sleepTime = 0.0;
         [NSApp sendEvent: event];
+
+        if (wxTheApp)
+            wxTheApp->MacSetCurrentEvent(formerEvent , formerHandler);
     }
     else
     {
@@ -175,6 +181,13 @@ void wxGUIEventLoop::DoStop()
     [NSApp stop:0];
 }
 
+CFRunLoopRef wxGUIEventLoop::CFGetCurrentRunLoop() const
+{
+    NSRunLoop* nsloop = [NSRunLoop currentRunLoop];
+    return [nsloop getCFRunLoop];
+}
+
+
 // TODO move into a evtloop_osx.cpp
 
 wxModalEventLoop::wxModalEventLoop(wxWindow *modalWindow)