workspaces: update persistence on workspace rename (#9368)

This commit is contained in:
Roberto Previdi
2025-02-15 15:01:52 +01:00
committed by GitHub
parent 7a6fde8414
commit 410da2e46f
4 changed files with 49 additions and 24 deletions

View File

@@ -648,6 +648,12 @@ void CWorkspace::rename(const std::string& name) {
Debug::log(LOG, "CWorkspace::rename: Renaming workspace {} to '{}'", m_iID, name);
m_szName = name;
const auto WORKSPACERULE = g_pConfigManager->getWorkspaceRuleFor(m_pSelf.lock());
m_bPersistent = WORKSPACERULE.isPersistent;
if (WORKSPACERULE.isPersistent)
g_pCompositor->ensurePersistentWorkspacesPresent(std::vector<SWorkspaceRule>{WORKSPACERULE}, m_pSelf.lock());
g_pEventManager->postEvent({"renameworkspace", std::to_string(m_iID) + "," + m_szName});
}