mirror of
https://github.com/hyprwm/Hyprland
synced 2026-05-02 11:18:07 +02:00
refactor: unregister exec rules after applying them
Remove the unused toRemove vector and defer unregistering exec rules until after applyStaticRule/applyDynamicRule so exec rules are applied before being removed from the rule engine.
This commit is contained in:
parent
1ababf4575
commit
3d116f53ca
1 changed files with 1 additions and 6 deletions
|
|
@ -545,7 +545,6 @@ void CWindowRuleApplicator::readStaticRules() {
|
|||
|
||||
static_ = {};
|
||||
|
||||
std::vector<SP<CWindowRule>> toRemove;
|
||||
std::vector<SP<CWindowRule>> execRules;
|
||||
bool tagsWereChanged = false;
|
||||
|
||||
|
|
@ -559,7 +558,6 @@ void CWindowRuleApplicator::readStaticRules() {
|
|||
continue;
|
||||
|
||||
if (wr->isExecRule()) {
|
||||
toRemove.emplace_back(wr);
|
||||
execRules.emplace_back(wr);
|
||||
continue;
|
||||
}
|
||||
|
|
@ -569,10 +567,6 @@ void CWindowRuleApplicator::readStaticRules() {
|
|||
tagsWereChanged = tagsWereChanged || RES.tagsChanged;
|
||||
}
|
||||
|
||||
for (const auto& wr : toRemove) {
|
||||
ruleEngine()->unregisterRule(wr);
|
||||
}
|
||||
|
||||
// recheck some props people might wanna use for static rules.
|
||||
std::underlying_type_t<eRuleProperty> propsToRecheck = RULE_PROP_NONE;
|
||||
if (tagsWereChanged)
|
||||
|
|
@ -600,6 +594,7 @@ void CWindowRuleApplicator::readStaticRules() {
|
|||
for (const auto& wr : execRules) {
|
||||
applyStaticRule(wr);
|
||||
applyDynamicRule(wr);
|
||||
ruleEngine()->unregisterRule(wr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue