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.
This commit is contained in:
Vlad Zahorodnii 2022-11-25 20:25:28 +02:00
parent c784217eae
commit 65cd40e85d
2 changed files with 5 additions and 3 deletions

View file

@ -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());

View file

@ -115,8 +115,6 @@ private:
std::unique_ptr<KWayland::Client::Pointer> m_pointer;
std::unique_ptr<KWayland::Client::PointerPinchGesture> m_pinchGesture;
std::unique_ptr<KWayland::Client::PointerSwipeGesture> 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();