From b36894884eff05bff6121930c7468959d5b6072e Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Wed, 14 Feb 2024 16:56:27 +0000 Subject: [PATCH] wayland: Dispatch mouse events to internal windows via QWindowSystemInterface QWindowSystemInterface goes via QGuiApplication which updates some internal properties. Most notably QGuiApplication::lastCursorPosition which is used by advanced menu closing behaviour. BUG: 478061 --- src/input.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/input.cpp b/src/input.cpp index 006512a896..25f944e779 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -1188,12 +1188,14 @@ class InternalWindowEventFilter : public InputEventFilter // the handle can be nullptr if the tooltip gets closed while focus updates are blocked return false; } - QMouseEvent mouseEvent(event->type(), - event->pos() - internal->position(), - event->globalPosition(), - event->button(), event->buttons(), event->modifiers()); - QCoreApplication::sendEvent(internal, &mouseEvent); - return mouseEvent.isAccepted(); + const bool isAccepted = QWindowSystemInterface::handleMouseEvent(internal, + event->position() - internal->position(), + event->globalPosition(), + event->buttons(), + event->button(), + event->type(), + event->modifiers()); + return isAccepted; } bool wheelEvent(WheelEvent *event) override {