]> git.saurik.com Git - wxWidgets.git/blobdiff - src/x11/evtloop.cpp
don't write the strings to the stream one char at a time, it's *horribly* slow
[wxWidgets.git] / src / x11 / evtloop.cpp
index 14ae85eec910ca23a57ee8d7993c36d93475a4c9..15e344b6f0ffed8833f2d7abf3be46a8756fa0ee 100644 (file)
@@ -239,10 +239,20 @@ bool wxEventLoop::Dispatch()
     
     if (XPending((Display*) wxGetDisplay()) == 0)
     {
+#if wxUSE_NANOX
+        GR_TIMEOUT timeout = 10; // Milliseconds
+        // Wait for next event, or timeout
+        GrGetNextEventTimeout(& event, timeout);
+
+        // Fall through to ProcessEvent.
+        // we'll assume that ProcessEvent will just ignore
+        // the event if there was a timeout and no event.
+            
+#else
         struct timeval tv;
         tv.tv_sec=0;
         tv.tv_usec=10000; // TODO make this configurable
-        int fd = ConnectionNumber(dsp);
+        int fd = ConnectionNumber((Display*) wxGetDisplay());
         fd_set readset;
         FD_ZERO(&readset);
         FD_SET(fd, &readset);
@@ -256,6 +266,7 @@ bool wxEventLoop::Dispatch()
             // An event was pending, so get it
             XNextEvent((Display*) wxGetDisplay(), & event);
         }
+#endif
     } else
     {
        XNextEvent((Display*) wxGetDisplay(), & event);