X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1b0fb34be895a9596131233edd1bf68b10c052b4..229d3f1c1fac88569a94b7a22fdc3149d57a46d4:/src/x11/evtloop.cpp diff --git a/src/x11/evtloop.cpp b/src/x11/evtloop.cpp index da6b8f6d82..dd8a8f030e 100644 --- a/src/x11/evtloop.cpp +++ b/src/x11/evtloop.cpp @@ -25,7 +25,10 @@ #include "wx/app.h" #include "wx/evtloop.h" #include "wx/tooltip.h" - +#if wxUSE_THREADS +#include "wx/thread.h" +#endif +#include "wx/timer.h" #include "wx/x11/private.h" #include "X11/Xlib.h" @@ -52,7 +55,7 @@ public: public: // preprocess an event, return TRUE if processed (i.e. no further // dispatching required) - bool PreProcessMessage(XEvent* event); + bool PreProcessEvent(XEvent* event); // the exit code of the event loop int m_exitcode; @@ -152,17 +155,20 @@ int wxEventLoop::Run() m_impl->m_keepGoing = TRUE; while ( m_impl->m_keepGoing ) { -#if wxUSE_THREADS - wxMutexGuiLeaveOrEnter(); +#if 0 // wxUSE_THREADS + wxMutexGuiLeaveOrEnter(); #endif // wxUSE_THREADS // generate and process idle events for as long as we don't have // anything else to do while ( ! Pending() ) { +#if wxUSE_TIMER + wxTimer::NotifyTimers(); // TODO: is this the correct place for it? +#endif if (!m_impl->SendIdleEvent()) { -#if wxUSE_THREADS +#if 0 // wxUSE_THREADS // leave the main loop to give other threads a chance to // perform their GUI work wxMutexGuiLeave(); @@ -205,8 +211,8 @@ void wxEventLoop::Exit(int rc) bool wxEventLoop::Pending() const { - XFlush(wxGetDisplay()); - return (XPending(wxGetDisplay()) > 0); + XFlush((Display*) wxGetDisplay()); + return (XPending((Display*) wxGetDisplay()) > 0); } bool wxEventLoop::Dispatch() @@ -215,7 +221,7 @@ bool wxEventLoop::Dispatch() // TODO allowing for threads, as per e.g. wxMSW - XNextEvent(wxGetDisplay(), & event); + XNextEvent((Display*) wxGetDisplay(), & event); m_impl->ProcessEvent(& event); return TRUE; }