Do not send double click when press was not accepted
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>
Mon, 7 May 2012 10:38:14 +0000 (13:38 +0300)
committerQt by Nokia <qt-info@nokia.com>
Tue, 8 May 2012 22:56:16 +0000 (00:56 +0200)
Sending the double click does not make sense in this case. In the
worst case something accepts the double click, leaving the mouse
grabber set, which results in blocking all further input due to having
everything delivered to that one item.

Change-Id: Ief4de360203e55e56f83179075e050f717a12108
Reviewed-by: Martin Jones <martin.jones@nokia.com>
src/quick/items/qquickcanvas.cpp

index 9a9a70b..da870fd 100644 (file)
@@ -411,7 +411,7 @@ void QQuickCanvasPrivate::translateTouchToMouse(QTouchEvent *event)
                 event->setAccepted(true);
             else
                 touchMouseId = -1;
-            if (doubleClick) {
+            if (doubleClick && event->isAccepted()) {
                 touchMousePressTimestamp = 0;
                 QQuickMouseEventEx me = touchToMouseEvent(QEvent::MouseButtonDblClick, p);
                 me.setTimestamp(event->timestamp());