Do not generate mouse event on the first motion event.
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>
Wed, 25 Jan 2012 18:36:19 +0000 (19:36 +0100)
committerLaszlo Agocs <laszlo.p.agocs@nokia.com>
Thu, 26 Jan 2012 08:23:34 +0000 (09:23 +0100)
This event comes before the button event and thus must not result in a
Qt mouse event. Instead, the button event will generate the
MouseButtonPressed with the position sent in this motion.

Change-Id: I97887d4d5fcd54575d6f4e9523a04569424c0bc2
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
src/plugins/platforms/wayland/qwaylandinputdevice.cpp

index 7d1a647..4a9a527 100644 (file)
@@ -136,11 +136,14 @@ void QWaylandInputDevice::inputHandleMotion(void *data,
     inputDevice->mSurfacePos = QPoint(surface_x, surface_y);
     inputDevice->mGlobalPos = QPoint(x, y);
     inputDevice->mTime = time;
-    QWindowSystemInterface::handleMouseEvent(window->window(),
-                                            time,
-                                            inputDevice->mSurfacePos,
-                                            inputDevice->mGlobalPos,
-                                             inputDevice->mButtons);
+
+    if (inputDevice->mButtons) {
+        QWindowSystemInterface::handleMouseEvent(window->window(),
+                                                 time,
+                                                 inputDevice->mSurfacePos,
+                                                 inputDevice->mGlobalPos,
+                                                 inputDevice->mButtons);
+    }
 }
 
 void QWaylandInputDevice::inputHandleButton(void *data,