core: match all workspace rules instead of the first one only (#5340)
This commit is contained in:
parent
1aed45f61d
commit
5e8c25d498
7 changed files with 91 additions and 38 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue