summaryrefslogtreecommitdiff
path: root/src/Compositor.cpp
diff options
context:
space:
mode:
authorthejch <66577496+thejch@users.noreply.github.com>2024-03-30 17:49:53 -0700
committerGitHub <noreply@github.com>2024-03-31 00:49:53 +0000
commit5e8c25d498ed5cb7852ae74a876b0c138a62d59d (patch)
tree904e8d5f5c9fa10e540b02d229f0f3a83f3dfc0a /src/Compositor.cpp
parent1aed45f61d2dd48943a63cabf7bd77c19a59cf62 (diff)
core: match all workspace rules instead of the first one only (#5340)
Diffstat (limited to 'src/Compositor.cpp')
-rw-r--r--src/Compositor.cpp15
1 files changed, 11 insertions, 4 deletions
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;
}