diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp index 5e968796444..e684e7598b9 100644 --- a/src/gui/kernel/qwindowsysteminterface.cpp +++ b/src/gui/kernel/qwindowsysteminterface.cpp @@ -98,7 +98,12 @@ bool QWindowSystemHelper::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.