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
This commit is contained in:
David Edmundson 2024-02-14 16:56:27 +00:00
parent 5244f9f406
commit b36894884e

View file

@ -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<QWindowSystemInterface::SynchronousDelivery>(internal,
event->position() - internal->position(),
event->globalPosition(),
event->buttons(),
event->button(),
event->type(),
event->modifiers());
return isAccepted;
}
bool wheelEvent(WheelEvent *event) override
{