From 5e8c25d498ed5cb7852ae74a876b0c138a62d59d Mon Sep 17 00:00:00 2001 From: thejch <66577496+thejch@users.noreply.github.com> Date: Sat, 30 Mar 2024 17:49:53 -0700 Subject: core: match all workspace rules instead of the first one only (#5340) --- src/Compositor.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/Compositor.cpp') diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 30e769e3..3ac9a73f 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -1260,8 +1260,13 @@ void CCompositor::sanityCheckWorkspaces() { auto it = m_vWorkspaces.begin(); while (it != m_vWorkspaces.end()) { - const auto WORKSPACERULE = g_pConfigManager->getWorkspaceRuleFor(it->get()); - if (WORKSPACERULE.isPersistent) { + const auto WORKSPACERULES = g_pConfigManager->getWorkspaceRulesFor(it->get()); + bool isPersistent = false; + for (auto& wsRule : WORKSPACERULES) { + if (wsRule.isPersistent) + isPersistent = true; + } + if (isPersistent) { ++it; continue; } @@ -1288,8 +1293,10 @@ void CCompositor::sanityCheckWorkspaces() { continue; } if (!WORKSPACE->m_bOnCreatedEmptyExecuted) { - if (auto cmd = WORKSPACERULE.onCreatedEmptyRunCmd) - g_pKeybindManager->spawn(*cmd); + for (auto& wsRule : WORKSPACERULES) { + if (auto cmd = wsRule.onCreatedEmptyRunCmd) + g_pKeybindManager->spawn(*cmd); + } WORKSPACE->m_bOnCreatedEmptyExecuted = true; } -- cgit v1.2.3