summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2023-01-17 16:34:25 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-01-18 18:24:57 +0000
commit2877f076ddf04eb1bdd6c9eff5d0d042aabfa57e (patch)
tree5f62e81a0777175f22ae0bfb6467646eac9c4796
parentaf1aa812b3b476d7c40c45e35f2bc778e322c985 (diff)
Respect custom QWSI event handler when delivering synchronous events
Fixes: QTBUG-110268 Change-Id: I25195904cfc18d593db1be713b6e899e55eb922f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 2813e2814e185bf8d2426c5eb3d6b2c243ee72c3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/gui/kernel/qwindowsysteminterface.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp
index 21091f66fa..051fe38a48 100644
--- a/src/gui/kernel/qwindowsysteminterface.cpp
+++ b/src/gui/kernel/qwindowsysteminterface.cpp
@@ -98,7 +98,12 @@ bool QWindowSystemHelper<QWindowSystemInterface::SynchronousDelivery>::handleEve
if (QThread::currentThread() == QGuiApplication::instance()->thread()) {
EventType event(args...);
// Process the event immediately on the Gui thread and return the accepted state
- QGuiApplicationPrivate::processWindowSystemEvent(&event);
+ if (QWindowSystemInterfacePrivate::eventHandler) {
+ if (!QWindowSystemInterfacePrivate::eventHandler->sendEvent(&event))
+ return false;
+ } else {
+ QGuiApplicationPrivate::processWindowSystemEvent(&event);
+ }
return event.eventAccepted;
} else {
// Post the event on the Qt main thread queue and flush the queue.