summaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
authorKai Uwe Broulik <kde@privat.broulik.de>2023-08-24 13:12:38 +0200
committerKai Uwe Broulik <kde@privat.broulik.de>2023-08-25 08:50:07 +0200
commit30216b545f3ef0a9bf465e57ba04b054d2a96728 (patch)
tree0eb1b14dcfbc35a02fa49181259b9b436ad7ab3a /src/client
parent1452c8d6ee8fe59763d9d48549fe0fbd2466015c (diff)
QWaylandInputDevice: Reset cursor surface state when using shape cursor
CursorSurface::update only calls set_cursor if the hotspot or serial has changed. Reset its state when using a shape cursor to ensure switching back to a cursor surface (e.g. when switching from a shape to a bitmap cursor) works as expected. Pick-to: 6.6 Change-Id: Ia04dff468c251030a75e9f1eac642ed764879125 Reviewed-by: David Edmundson <davidedmundson@kde.org>
Diffstat (limited to 'src/client')
-rw-r--r--src/client/qwaylandinputdevice.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp
index a5d3eb8f2..2a5cf9003 100644
--- a/src/client/qwaylandinputdevice.cpp
+++ b/src/client/qwaylandinputdevice.cpp
@@ -185,12 +185,18 @@ public:
m_pointer, &QWaylandInputDevice::Pointer::updateCursor);
}
+ void reset()
+ {
+ m_setSerial = 0;
+ m_hotspot = QPoint();
+ }
+
void hide()
{
uint serial = m_pointer->mEnterSerial;
Q_ASSERT(serial);
m_pointer->set_cursor(serial, nullptr, 0, 0);
- m_setSerial = 0;
+ reset();
}
// Size and hotspot are in surface coordinates
@@ -308,6 +314,9 @@ void QWaylandInputDevice::Pointer::updateCursor()
}
if (mCursor.shape) {
+ if (mCursor.surface) {
+ mCursor.surface->reset();
+ }
mCursor.shape->setShape(mEnterSerial, shape);
return;
}