diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-06-16 18:37:59 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-06-16 18:52:34 +0900 |
commit | 2584dba8aabfa2db8297dcfa258d33545ed6af43 (patch) | |
tree | be8b024cd0ba58c17a0dfc4a90ec0932c35a5543 /src/kernel/tqeventloop_x11.cpp | |
parent | e190684fba08e3189cc8c2c4221823b17a9d48be (diff) | |
download | tqt-2584dba8aabfa2db8297dcfa258d33545ed6af43.tar.gz tqt-2584dba8aabfa2db8297dcfa258d33545ed6af43.zip |
Fix handling of socket notifier events in gmainloop functions.
This resolves issue #231.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'src/kernel/tqeventloop_x11.cpp')
-rw-r--r-- | src/kernel/tqeventloop_x11.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/kernel/tqeventloop_x11.cpp b/src/kernel/tqeventloop_x11.cpp index 8a2edf804..09fc42e82 100644 --- a/src/kernel/tqeventloop_x11.cpp +++ b/src/kernel/tqeventloop_x11.cpp @@ -231,8 +231,11 @@ bool TQEventLoop::processEvents( ProcessEventsFlags flags ) } } + // Include or exclude SocketNotifiers (by setting or cleaning poll events) + // Socket notifier events are only activated in the core application event loop, + // so filter them out in other event loops. int highest = 0; - if ( ! ( flags & ExcludeSocketNotifiers ) ) { + if (!(flags & ExcludeSocketNotifiers) && TQApplication::isGuiThread()) { // return the highest fd we can wait for input on if ( d->sn_highest >= 0 ) { // has socket notifier(s) if ( d->sn_vec[0].list && ! d->sn_vec[0].list->isEmpty() ) @@ -370,7 +373,8 @@ bool TQEventLoop::processEvents( ProcessEventsFlags flags ) } // activate socket notifiers - if ( ! ( flags & ExcludeSocketNotifiers ) && nsel > 0 && d->sn_highest >= 0 ) { + if (!(flags & ExcludeSocketNotifiers) && nsel > 0 && d->sn_highest >= 0 && + TQApplication::isGuiThread()) { // if select says data is ready on any socket, then set the socket notifier // to pending int i; |