diff --git a/virtualdesktops.h b/virtualdesktops.h --- a/virtualdesktops.h +++ b/virtualdesktops.h @@ -495,7 +495,6 @@ NETRootInfo *m_rootInfo; KWayland::Server::PlasmaVirtualDesktopManagementInterface *m_virtualDesktopManagement = nullptr; KSharedConfig::Ptr m_config; - bool m_isLoading = false; KWIN_SINGLETON_VARIABLE(VirtualDesktopManager, s_manager) }; diff --git a/virtualdesktops.cpp b/virtualdesktops.cpp --- a/virtualdesktops.cpp +++ b/virtualdesktops.cpp @@ -536,6 +536,8 @@ return true; } +static bool s_loadingDesktopSettings = false; + void VirtualDesktopManager::setCount(uint count) { count = qBound(1, count, VirtualDesktopManager::maximum()); @@ -565,7 +567,7 @@ while (uint(m_desktops.count()) < count) { auto vd = new VirtualDesktop(this); vd->setX11DesktopNumber(m_desktops.count() + 1); - if (!m_isLoading) { + if (!s_loadingDesktopSettings) { vd->setId(QUuid::createUuid().toString().toUtf8()); } m_desktops << vd; @@ -654,16 +656,12 @@ ); } -static bool s_loadingDesktopSettings = false; - void VirtualDesktopManager::load() { s_loadingDesktopSettings = true; if (!m_config) { return; } - //FIXME: how to avoid this? - m_isLoading = true; QString groupname; if (screen_number == 0) { groupname = QStringLiteral("Desktops"); @@ -710,7 +708,6 @@ } s_loadingDesktopSettings = false; - m_isLoading = false; } void VirtualDesktopManager::save()