diff options
author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2016-07-21 22:19:17 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@qt.io> | 2016-07-23 17:23:02 +0000 |
commit | ba3fb9f8ee4ba735182713272c3abdc01d1de763 (patch) | |
tree | f5193cc64cfc370c8c6f5a52176e7068846ac5da /src | |
parent | 7436638b51ef7b121afd5ea8135e4a3ce5913fa4 (diff) |
Removing mouse grab must not cancel touch grab
When calling setMouseGrab(nullptr) we would ungrab the touch point that
corresponds to the touchMouseId. This is why the code could not call
setMouseGrab(nullptr) before. Remove the wrong removal of the item from
itemForTouchPointId.
This was not a problem so far because every part of the code that cares
about touch would do special handling and not call this function, but
access QQuickWindow's internals instead.
Change-Id: I032065d5b6db8cd85c78a022a168dbd220440f5f
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/quick/items/qquickwindow.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 73b04f825a..7a524a1377 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -753,13 +753,10 @@ void QQuickWindowPrivate::setMouseGrabber(QQuickItem *grabber) QQuickItem *oldGrabber = q->mouseGrabberItem(); mouseGrabberItem = grabber; - if (touchMouseId != -1) { + if (grabber && touchMouseId != -1) { // update the touch item for mouse touch id to the new grabber - itemForTouchPointId.remove(touchMouseId); - if (grabber) { - qCDebug(DBG_TOUCH_TARGET) << "TP (mouse)" << touchMouseId << "->" << q->mouseGrabberItem(); - itemForTouchPointId[touchMouseId] = grabber; - } + qCDebug(DBG_TOUCH_TARGET) << "TP (mouse)" << touchMouseId << "->" << q->mouseGrabberItem(); + itemForTouchPointId[touchMouseId] = grabber; } if (oldGrabber) { |