Add mouse move events to the window compositor
authorJørgen Lind <jorgen.lind@nokia.com>
Tue, 3 Jan 2012 12:47:33 +0000 (13:47 +0100)
committerJørgen Lind <jorgen.lind@nokia.com>
Wed, 4 Jan 2012 09:34:04 +0000 (10:34 +0100)
Change-Id: Iacdfbd55feb5db4d38eac6e2729684052a46afa9
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
examples/qwindow-compositor/qwindowcompositor.cpp

index 039dfdd..59e181a 100644 (file)
@@ -144,6 +144,13 @@ bool QWindowCompositor::eventFilter(QObject *obj, QEvent *event)
         }
         break;
     }
+    case QEvent::MouseMove: {
+        QMouseEvent *me = static_cast<QMouseEvent *>(event);
+        QPoint local;
+        WaylandSurface *targetSurface = surfaceAt(me->pos(), &local);
+        if (targetSurface)
+            targetSurface->sendMouseMoveEvent(local);
+    }
     case QEvent::KeyPress: {
         QKeyEvent *ke = static_cast<QKeyEvent *>(event);
         WaylandSurface *targetSurface = inputFocus();