summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2012-02-02 18:03:10 +0200
committerJørgen Lind <jorgen.lind@nokia.com>2012-02-02 17:23:48 +0100
commitc8ca4b74a8ad7469c3597ec9412cf175b1ef6fcc (patch)
treeb9c5651513f0b0851acf5b6124427877a018e807 /src
parentde7e097bbb1d29db63d70bfb1e3a03c5253316fd (diff)
Fix mouse handling in qml-compositor.
The pointer focus must be set in pressed. We cannot rely on the implicit mouse tracking behavior of QWindow for QML stuff because the WaylandSurfaceItems will not get mouse moves outside of a press-release sequence. Change-Id: Ic2cf2a7497cac7397bcfa26440dd05cded6182dc Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/compositor/compositor_api/waylandsurfaceitem.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/compositor/compositor_api/waylandsurfaceitem.cpp b/src/compositor/compositor_api/waylandsurfaceitem.cpp
index 605e950e0..a080f836f 100644
--- a/src/compositor/compositor_api/waylandsurfaceitem.cpp
+++ b/src/compositor/compositor_api/waylandsurfaceitem.cpp
@@ -149,6 +149,8 @@ void WaylandSurfaceItem::mousePressEvent(QMouseEvent *event)
{
if (m_surface) {
WaylandInputDevice *inputDevice = m_surface->compositor()->defaultInputDevice();
+ if (inputDevice->mouseFocus() != m_surface)
+ inputDevice->setMouseFocus(m_surface, event->pos(), event->globalPos());
inputDevice->sendMousePressEvent(event->button(), toSurface(event->pos()));
}
}