summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/kernel/tqeventloop_x11_glib.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/kernel/tqeventloop_x11_glib.cpp b/src/kernel/tqeventloop_x11_glib.cpp
index cf2126591..3608091b5 100644
--- a/src/kernel/tqeventloop_x11_glib.cpp
+++ b/src/kernel/tqeventloop_x11_glib.cpp
@@ -408,13 +408,15 @@ bool TQEventLoop::gsourcePrepare(GSource *gs, int * timeout)
static timeval zerotm;
timeval *tm = 0;
if ( ! ( flags & 0x08 ) ) { // 0x08 == ExcludeTimers for X11 only
- tm = qt_wait_timer(); // wait for timer or X event
- if ( !canWait ) {
- if ( !tm ) {
- tm = &zerotm;
+ if (TQApplication::isGuiThread()) {
+ tm = qt_wait_timer(); // wait for TQt timers
+ if ( !canWait ) {
+ if ( !tm ) {
+ tm = &zerotm;
+ }
+ tm->tv_sec = 0; // no time to wait
+ tm->tv_usec = 0;
}
- tm->tv_sec = 0; // no time to wait
- tm->tv_usec = 0;
}
}
@@ -525,13 +527,15 @@ bool TQEventLoop::gsourceCheck(GSource *gs) {
}
// check if we have timers to activate?
- timeval * tm = qt_wait_timer();
- if (tm && (tm->tv_sec == 0 && tm->tv_usec == 0 )) {
+ if (TQApplication::isGuiThread()) {
+ 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");
+ printf("inside gsourceCheck(2) qtwaittimer!\n");
#endif
- return TRUE;
+ return TRUE;
+ }
}
// nothing to dispatch