summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2017-11-16 11:30:43 +0100
committerJani Heikkinen <jani.heikkinen@qt.io>2017-11-23 05:35:34 +0000
commit28893b5ab2ee0984d6caa813ac1bbecf6d9e583c (patch)
tree66b93b71df0138eeab5803d3e1096fc73a5fb9f4
parent380e2fd1cd37c4d6e7ceb95998c62d7bcbec57ed (diff)
never skip updating passive grabbers, or ungrab, on mouse release
If you drag a ListView with the right mouse button, it was reacting, but not rebounding after release. And if a PointHandler is used to show feedback about mouse position, it also did not get the release. This was due to returning early from deliverMouseEvent. Change-Id: I24b39e4769d6824d3bd1f400dbf1f973bb29fbb6 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
-rw-r--r--src/quick/items/qquickwindow.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index e865a609a6..2dc3caf430 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -1712,24 +1712,27 @@ void QQuickWindowPrivate::deliverMouseEvent(QQuickPointerMouseEvent *pointerEven
if (point->exclusiveGrabber()) {
if (auto grabber = point->grabberItem()) {
+ bool handled = false;
if (sendFilteredPointerEvent(pointerEvent, grabber))
- return;
+ handled = true;
// if the grabber is an Item:
// if the update consists of changing button state, don't accept it unless
// the button is one in which the grabber is interested
Qt::MouseButtons acceptedButtons = grabber->acceptedMouseButtons();
- if (pointerEvent->button() != Qt::NoButton && acceptedButtons
+ if (!handled && pointerEvent->button() != Qt::NoButton && acceptedButtons
&& !(acceptedButtons & pointerEvent->button())) {
pointerEvent->setAccepted(false);
- return;
+ handled = true;
}
// send update
- QPointF localPos = grabber->mapFromScene(lastMousePosition);
- auto me = pointerEvent->asMouseEvent(localPos);
- me->accept();
- QCoreApplication::sendEvent(grabber, me);
- point->setAccepted(me->isAccepted());
+ if (!handled) {
+ QPointF localPos = grabber->mapFromScene(lastMousePosition);
+ auto me = pointerEvent->asMouseEvent(localPos);
+ me->accept();
+ QCoreApplication::sendEvent(grabber, me);
+ point->setAccepted(me->isAccepted());
+ }
// release event: ungrab if no buttons are pressed anymore
if (mouseIsReleased)