summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKai Uwe Broulik <kde@privat.broulik.de>2023-08-24 13:12:38 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-08-25 07:33:07 +0000
commite8506d19d21a2ba0a41e15e3976982e4d52dfec6 (patch)
treed9f478994c58124e672b8f9eeea18bbd02a85747 /src
parent4bfd69da324afe5bcd48c52ef2fac30c4f010d2f (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. Change-Id: Ia04dff468c251030a75e9f1eac642ed764879125 Reviewed-by: David Edmundson <davidedmundson@kde.org> (cherry picked from commit 30216b545f3ef0a9bf465e57ba04b054d2a96728) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-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;
}