From 65cd40e85d2bfd53003410a332acc02a21cfef7c Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Fri, 25 Nov 2022 20:25:28 +0200 Subject: [PATCH] backends/wayland: Call wl_pointer.set_cursor when pointer enters an output We must always call wl_pointer.set_cursor when the pointer enters the surface. --- src/backends/wayland/wayland_backend.cpp | 2 +- src/backends/wayland/wayland_backend.h | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/backends/wayland/wayland_backend.cpp b/src/backends/wayland/wayland_backend.cpp index c6dfca7e66..5c0f124422 100644 --- a/src/backends/wayland/wayland_backend.cpp +++ b/src/backends/wayland/wayland_backend.cpp @@ -138,7 +138,7 @@ WaylandInputDevice::WaylandInputDevice(KWayland::Client::Pointer *pointer, Wayla , m_pointer(pointer) { connect(pointer, &Pointer::entered, this, [this](quint32 serial, const QPointF &relativeToSurface) { - m_enteredSerial = serial; + m_seat->backend()->cursor()->install(); }); connect(pointer, &Pointer::motion, this, [this](const QPointF &relativeToSurface, quint32 time) { WaylandOutput *output = m_seat->backend()->findOutput(m_pointer->enteredSurface()); diff --git a/src/backends/wayland/wayland_backend.h b/src/backends/wayland/wayland_backend.h index 01c73af149..c3970e44c7 100644 --- a/src/backends/wayland/wayland_backend.h +++ b/src/backends/wayland/wayland_backend.h @@ -115,8 +115,6 @@ private: std::unique_ptr m_pointer; std::unique_ptr m_pinchGesture; std::unique_ptr m_swipeGesture; - - uint32_t m_enteredSerial = 0; }; class WaylandInputBackend : public InputBackend @@ -220,6 +218,10 @@ public: { return m_seat.get(); } + WaylandCursor *cursor() const + { + return m_waylandCursor.get(); + } bool supportsPointerLock(); void togglePointerLock();