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.
This commit is contained in:
Vlad Zahorodnii 2023-10-19 14:11:45 +03:00 committed by David Edmundson
parent 2eabd17547
commit f9163bf6a5

View file

@ -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()