diff options
| author | Shawn Rutledge <shawn.rutledge@qt.io> | 2026-09-02 15:13:34 +0200 |
|---|---|---|
| committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2026-09-25 14:05:56 +0000 |
| commit | 45079d17f457ee45e4467dd427666df3f5fc043f (patch) | |
| tree | f6a13881ecf7b03dbbe120195b506b4a96347ca3 | |
| parent | 6dffe5113e04d9eafb26a7ea3e4b41487feb652c (diff) | |
Remove the synthetic mouse move that reset hover after a touch release
fd70c80fe1cac83776cc4730555c8e3dea930c1c made deliverTouchAsMouse() send
an extra QEvent::MouseMove back to the cursor position on synth-mouse
release elsewhere, so that MouseArea::mouseMoveEvent() would recompute
containsMouse and drop the hover. It was a hack: it invents an event
that no device produced, it only works for items that do not accept
touch events, and its condition depends on whether the platform happens
to drag the cursor to the touch point - which is why it is a no-op on
Windows but load-bearing on X11 and Wayland.
QTBUG-61938 and QTBUG-68970 were regressions filed against it, both
making the same point: converting touch to mouse is fine, inserting
extra events in between is not.
The previous commit clears fingertip hover directly, and MouseArea
resets containsMouse itself on a fingertip release, so the synthetic
move has nothing left to do - it was only ever a roundabout way of
reaching setHovered(false), and it reached it for just one of the three
types that needed it.
This is a deliberate behavior change for anything that relied on
receiving that MouseMove: it is gone, and hover is now ended with a
QEvent::HoverLeave instead, which is what an item would have gotten from
a real cursor leaving it.
Pick-to: 6.12
Task-number: QTBUG-62912
Task-number: QTBUG-40856
Fixes: QTBUG-61938
Fixes: QTBUG-68970
Change-Id: I322973c3065eaa6de331d51a8b407bb23e65f9b5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| -rw-r--r-- | src/quick/util/qquickdeliveryagent.cpp | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/src/quick/util/qquickdeliveryagent.cpp b/src/quick/util/qquickdeliveryagent.cpp index 1a5aeb60b8..4e349a0ac8 100644 --- a/src/quick/util/qquickdeliveryagent.cpp +++ b/src/quick/util/qquickdeliveryagent.cpp @@ -282,14 +282,6 @@ bool QQuickDeliveryAgentPrivate::deliverTouchAsMouse(QQuickItem *item, QTouchEve touchToMouseEvent(QEvent::MouseButtonRelease, p, &event, &me); QCoreApplication::sendEvent(item, &me); - if (item->acceptHoverEvents() && p.globalPosition() != QGuiApplicationPrivate::lastCursorPosition) { - QPointF localMousePos(qInf(), qInf()); - if (QWindow *w = item->window()) - localMousePos = item->mapFromScene(w->mapFromGlobal(QGuiApplicationPrivate::lastCursorPosition)); - QMouseEvent mm(QEvent::MouseMove, localMousePos, QGuiApplicationPrivate::lastCursorPosition, - Qt::NoButton, Qt::NoButton, event.modifiers()); - QCoreApplication::sendEvent(item, &mm); - } if (pointerEvent->exclusiveGrabber(p) == mouseGrabberItem) // might have ungrabbed due to event pointerEvent->setExclusiveGrabber(p, nullptr); |
