diff options
Diffstat (limited to 'src/kernel/qeventloop_x11_glib.cpp')
-rw-r--r-- | src/kernel/qeventloop_x11_glib.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/kernel/qeventloop_x11_glib.cpp b/src/kernel/qeventloop_x11_glib.cpp index 7106bf4e6..5db73a8fb 100644 --- a/src/kernel/qeventloop_x11_glib.cpp +++ b/src/kernel/qeventloop_x11_glib.cpp @@ -484,8 +484,9 @@ bool TQEventLoop::gsourceCheck(GSource *gs) { //if ( list ) { TQSockNotGPollFD *sn = list->first(); while ( sn ) { - if ( sn->gPollFD.revents ) + if ( sn->gPollFD.revents ) { return TRUE; + } sn = list->next(); } //} @@ -513,7 +514,7 @@ bool TQEventLoop::gsourceCheck(GSource *gs) { } // check if we have timers to activate? - timeval * tm =qt_wait_timer(); + timeval * tm = qt_wait_timer(); if (tm && (tm->tv_sec == 0 && tm->tv_usec == 0 )) { #ifdef DEBUG_QT_GLIBMAINLOOP printf("inside gsourceCheck(2) qtwaittimer!\n"); @@ -582,14 +583,18 @@ bool TQEventLoop::gsourceDispatch(GSource *gs) { sn = list->next(); } // } - - nevents += activateSocketNotifiers(); + + if (TQApplication::isGuiThread()) { + nevents += activateSocketNotifiers(); + } } // activate timers if ( ! ( flags & 0x08 ) ) { // 0x08 == ExcludeTimers for X11 only - nevents += activateTimers(); + if (TQApplication::isGuiThread()) { + nevents += activateTimers(); + } } // return true if we handled events, false otherwise |