summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2025-06-11 13:16:25 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2025-06-11 13:37:12 +0900
commit6da60fd237eeec4d1611c680202ab28b7e081112 (patch)
tree2c7b914c4b996cbbc82b855c48501d88958836d1
parentab450526c711cefb141f35a856a7b5a3a895c877 (diff)
downloadtqt-6da60fd237eeec4d1611c680202ab28b7e081112.tar.gz
tqt-6da60fd237eeec4d1611c680202ab28b7e081112.zip
Do not check for expired TQt timers in 'gsourcePrepare' and 'gsourceCheck'
since timers are only activated by the main GUI thread in 'gsourceDispatch'. This solves issue TDE/tdebase#635. Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
-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