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 <vlad.zahorodnii@kde.org>
Reviewed-by: David Edmundson <davidedmundson@kde.org>
This commit is contained in:
Kai Uwe Broulik 2023-08-27 21:10:54 +02:00
parent 5ff2599d51
commit 3e65306ec3

View File

@ -191,14 +191,6 @@ public:
m_hotspot = QPoint(); 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 // Size and hotspot are in surface coordinates
void update(wl_buffer *buffer, const QPoint &hotspot, const QSize &size, int bufferScale, bool animated = false) 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; auto shape = seat()->mCursor.shape;
if (shape == Qt::BlankCursor) { if (shape == Qt::BlankCursor) {
getOrCreateCursorSurface()->hide(); if (mCursor.surface)
mCursor.surface->reset();
set_cursor(mEnterSerial, nullptr, 0, 0);
return; return;
} }