diff options
| author | thejch <66577496+thejch@users.noreply.github.com> | 2024-04-05 08:54:30 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-05 16:54:30 +0100 |
| commit | 1e8f57c7340850ff08e4a4919e06d830be28b7b9 (patch) | |
| tree | f4abda938c24531e7234efd4375ae6e31ae435a5 /src/Compositor.cpp | |
| parent | 942172d2dc9194b95d637283ec3338c06c9c6597 (diff) | |
workspacerules: fix workspace rule loops (#5433)
Diffstat (limited to 'src/Compositor.cpp')
| -rw-r--r-- | src/Compositor.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
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; } |
