From f9163bf6a557801e6e0a72ce37f67bc0434f1a58 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Thu, 19 Oct 2023 14:11:45 +0300 Subject: [PATCH] Clear X11 cursor cache when XCB connection changes We need to clear it because if Xwayland restarts, the future Xwayland instance may have different cursor ids. --- src/cursor.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/cursor.cpp b/src/cursor.cpp index 0141e4fd9f..f91e67c924 100644 --- a/src/cursor.cpp +++ b/src/cursor.cpp @@ -118,6 +118,12 @@ Cursor::Cursor() loadThemeSettings(); QDBusConnection::sessionBus().connect(QString(), QStringLiteral("/KGlobalSettings"), QStringLiteral("org.kde.KGlobalSettings"), QStringLiteral("notifyChange"), this, SLOT(slotKGlobalSettingsNotifyChange(int, int))); + + if (kwinApp()->operationMode() != Application::OperationModeWaylandOnly) { + connect(kwinApp(), &Application::x11ConnectionChanged, this, [this]() { + m_cursors.clear(); + }); + } } Cursor::~Cursor()