summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-11-30 23:43:50 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-11-30 23:43:50 +0800
commit1ababf4575dcc7c983c2911b99f13641911fc673 (patch)
tree9140d009c2dca5b022f1b72e72d8dbbdd9595931
parent7e1e24fea615503a3cc05218c12b06c1b6cabdc7 (diff)
chore: apply exec rules after removal and use CWindowRulefix-tag
-rw-r--r--src/desktop/rule/windowRule/WindowRuleApplicator.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/desktop/rule/windowRule/WindowRuleApplicator.cpp b/src/desktop/rule/windowRule/WindowRuleApplicator.cpp
index f28aa5a5..18f3f69f 100644
--- a/src/desktop/rule/windowRule/WindowRuleApplicator.cpp
+++ b/src/desktop/rule/windowRule/WindowRuleApplicator.cpp
@@ -545,8 +545,9 @@ void CWindowRuleApplicator::readStaticRules() {
static_ = {};
- std::vector<SP<IRule>> toRemove;
- bool tagsWereChanged = false;
+ std::vector<SP<CWindowRule>> toRemove;
+ std::vector<SP<CWindowRule>> execRules;
+ bool tagsWereChanged = false;
for (const auto& r : ruleEngine()->rules()) {
if (r->type() != RULE_TYPE_WINDOW)
@@ -557,12 +558,15 @@ void CWindowRuleApplicator::readStaticRules() {
if (!wr->matches(m_window.lock(), true))
continue;
+ if (wr->isExecRule()) {
+ toRemove.emplace_back(wr);
+ execRules.emplace_back(wr);
+ continue;
+ }
+
applyStaticRule(wr);
- const auto RES = applyDynamicRule(wr); // also apply dynamic, because we won't recheck it before layout gets data
+ const auto RES = applyDynamicRule(wr);
tagsWereChanged = tagsWereChanged || RES.tagsChanged;
-
- if (wr->isExecRule())
- toRemove.emplace_back(wr);
}
for (const auto& wr : toRemove) {
@@ -592,6 +596,11 @@ void CWindowRuleApplicator::readStaticRules() {
applyStaticRule(wr);
}
}
+
+ for (const auto& wr : execRules) {
+ applyStaticRule(wr);
+ applyDynamicRule(wr);
+ }
}
void CWindowRuleApplicator::propertiesChanged(std::underlying_type_t<eRuleProperty> props) {