X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1016f0deb6320f742ee17de375d38f4159acc7ab..ba637f22e61113ab2296936f9a101e929cc05711:/src/x11/evtloop.cpp?ds=sidebyside diff --git a/src/x11/evtloop.cpp b/src/x11/evtloop.cpp index 14ae85eec9..15e344b6f0 100644 --- a/src/x11/evtloop.cpp +++ b/src/x11/evtloop.cpp @@ -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);