Some tweaks to WaylandSurfaceItem API.
authorSamuel Rødal <samuel.rodal@nokia.com>
Fri, 1 Apr 2011 11:41:33 +0000 (13:41 +0200)
committerSamuel Rødal <samuel.rodal@nokia.com>
Fri, 1 Apr 2011 11:41:33 +0000 (13:41 +0200)
Send mouse events regardless of focus.

src/qt-compositor/compositor_api/waylandsurfaceitem.cpp
src/qt-compositor/compositor_api/waylandsurfaceitem.h

index abc9ea3..90985f1 100644 (file)
@@ -127,20 +127,17 @@ QSGTextureProvider *WaylandSurfaceItem::textureProvider() const
 
 void WaylandSurfaceItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
 {
-    if (hasFocus())
-        m_surface->sendMousePressEvent(toSurface(event->pos()), event->button());
+    m_surface->sendMousePressEvent(toSurface(event->pos()), event->button());
 }
 
 void WaylandSurfaceItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
 {
-    if (hasFocus())
-        m_surface->sendMouseMoveEvent(toSurface(event->pos()));
+    m_surface->sendMouseMoveEvent(toSurface(event->pos()));
 }
 
 void WaylandSurfaceItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
 {
-    if (hasFocus())
-        m_surface->sendMouseReleaseEvent(toSurface(event->pos()), event->button());
+    m_surface->sendMouseReleaseEvent(toSurface(event->pos()), event->button());
 }
 
 void WaylandSurfaceItem::keyPressEvent(QKeyEvent *event)
index 70e0985..f335732 100644 (file)
@@ -57,6 +57,7 @@ public:
 
     QSGTextureProvider *textureProvider() const;
 
+protected:
     void mousePressEvent(QGraphicsSceneMouseEvent *event);
     void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
     void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);