From 1e8f57c7340850ff08e4a4919e06d830be28b7b9 Mon Sep 17 00:00:00 2001 From: thejch <66577496+thejch@users.noreply.github.com> Date: Fri, 5 Apr 2024 08:54:30 -0700 Subject: workspacerules: fix workspace rule loops (#5433) --- src/Compositor.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'src/Compositor.cpp') diff --git a/src/Compositor.cpp b/src/Compositor.cpp index bd9c73a0..5c1092ec 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -1257,13 +1257,8 @@ void CCompositor::sanityCheckWorkspaces() { auto it = m_vWorkspaces.begin(); while (it != m_vWorkspaces.end()) { - const auto WORKSPACERULES = g_pConfigManager->getWorkspaceRulesFor(*it); - bool isPersistent = false; - for (auto& wsRule : WORKSPACERULES) { - if (wsRule.isPersistent) - isPersistent = true; - } - if (isPersistent) { + const auto WORKSPACERULE = g_pConfigManager->getWorkspaceRuleFor(*it); + if (WORKSPACERULE.isPersistent) { ++it; continue; } @@ -1291,10 +1286,8 @@ void CCompositor::sanityCheckWorkspaces() { continue; } if (!WORKSPACE->m_bOnCreatedEmptyExecuted) { - for (auto& wsRule : WORKSPACERULES) { - if (auto cmd = wsRule.onCreatedEmptyRunCmd) - g_pKeybindManager->spawn(*cmd); - } + if (auto cmd = WORKSPACERULE.onCreatedEmptyRunCmd) + g_pKeybindManager->spawn(*cmd); WORKSPACE->m_bOnCreatedEmptyExecuted = true; } -- cgit v1.2.3