From f563e0e196d74d0884b4e599729e36f9f172f0e2 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Tue, 20 Nov 2018 12:23:51 +0100 Subject: Client: Fix incorrect enter serial in set_cursor Change-Id: Ibeacc5218acbd6003b85811a175ed00fd62a4b51 Reviewed-by: Paul Olav Tvete --- src/client/qwaylandinputdevice.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp index 37c6fbe9f..9d675ae21 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); -- cgit v1.2.3