summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2018-11-20 12:23:51 +0100
committerJohan Helsing <johan.helsing@qt.io>2018-11-21 13:39:36 +0000
commitf563e0e196d74d0884b4e599729e36f9f172f0e2 (patch)
tree54e0066313c69e24a5f6895b07a35e499ec47cc8
parenta7b3894416eb38b3a02e20284a23c8b887d81516 (diff)
Client: Fix incorrect enter serial in set_cursor
Change-Id: Ibeacc5218acbd6003b85811a175ed00fd62a4b51 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
-rw-r--r--src/client/qwaylandinputdevice.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp
index 37c6fbe9..9d675ae2 100644
--- a/src/client/qwaylandinputdevice.cpp
+++ b/src/client/qwaylandinputdevice.cpp
@@ -451,10 +451,6 @@ void QWaylandInputDevice::Pointer::pointer_enter(uint32_t serial, struct wl_surf
return;
QWaylandWindow *window = QWaylandWindow::fromWlSurface(surface);
-#if QT_CONFIG(cursor)
- window->window()->setCursor(window->window()->cursor());
-#endif
-
mFocus = window;
mSurfacePos = QPointF(wl_fixed_to_double(sx), wl_fixed_to_double(sy));
mGlobalPos = window->window()->mapToGlobal(mSurfacePos.toPoint());
@@ -462,6 +458,11 @@ void QWaylandInputDevice::Pointer::pointer_enter(uint32_t serial, struct wl_surf
mParent->mSerial = serial;
mEnterSerial = serial;
+#if QT_CONFIG(cursor)
+ // Depends on mEnterSerial being updated
+ window->window()->setCursor(window->window()->cursor());
+#endif
+
QWaylandWindow *grab = QWaylandWindow::mouseGrab();
if (!grab) {
EnterEvent evt(mSurfacePos, mGlobalPos);