summaryrefslogtreecommitdiffstats
path: root/src/kernel/qeventloop_x11_glib.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/qeventloop_x11_glib.cpp')
-rw-r--r--src/kernel/qeventloop_x11_glib.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/kernel/qeventloop_x11_glib.cpp b/src/kernel/qeventloop_x11_glib.cpp
index d37fbee..5226aa9 100644
--- a/src/kernel/qeventloop_x11_glib.cpp
+++ b/src/kernel/qeventloop_x11_glib.cpp
@@ -484,8 +484,9 @@ bool QEventLoop::gsourceCheck(GSource *gs) {
//if ( list ) {
QSockNotGPollFD *sn = list->first();
while ( sn ) {
- if ( sn->gPollFD.revents )
+ if ( sn->gPollFD.revents ) {
return TRUE;
+ }
sn = list->next();
}
//}
@@ -513,7 +514,7 @@ bool QEventLoop::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 QEventLoop::gsourceDispatch(GSource *gs) {
sn = list->next();
}
// }
-
- nevents += activateSocketNotifiers();
+
+ if (QApplication::isGuiThread()) {
+ nevents += activateSocketNotifiers();
+ }
}
// activate timers
if ( ! ( flags & 0x08 ) ) {
// 0x08 == ExcludeTimers for X11 only
- nevents += activateTimers();
+ if (QApplication::isGuiThread()) {
+ nevents += activateTimers();
+ }
}
// return true if we handled events, false otherwise