From 3e65306ec31f43870703350c2187fcbd063b34cd Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Sun, 27 Aug 2023 21:10:54 +0200 Subject: [PATCH] QWaylandInputDevice: Don't create cursor surface just for hiding it Just call set_cursor(null) directly. Pick-to: 6.6 Change-Id: Id10b7d41775a41c805962d77fba2d7d2b19956d0 Reviewed-by: Vlad Zahorodnii Reviewed-by: David Edmundson --- .../platforms/wayland/qwaylandinputdevice.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp index 2a5cf900360..4eba3c5897c 100644 --- a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp +++ b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp @@ -191,14 +191,6 @@ public: m_hotspot = QPoint(); } - void hide() - { - uint serial = m_pointer->mEnterSerial; - Q_ASSERT(serial); - m_pointer->set_cursor(serial, nullptr, 0, 0); - reset(); - } - // Size and hotspot are in surface coordinates void update(wl_buffer *buffer, const QPoint &hotspot, const QSize &size, int bufferScale, bool animated = false) { @@ -297,7 +289,9 @@ void QWaylandInputDevice::Pointer::updateCursor() auto shape = seat()->mCursor.shape; if (shape == Qt::BlankCursor) { - getOrCreateCursorSurface()->hide(); + if (mCursor.surface) + mCursor.surface->reset(); + set_cursor(mEnterSerial, nullptr, 0, 0); return; }