This commit is contained in:
Vaxry 2025-11-14 13:43:17 +00:00 committed by Mihai Fufezan
parent f36d44fbac
commit f9e0d4800f
Signed by: fufexan
SSH key fingerprint: SHA256:SdnKmEpJrDu1+2UO1QpB/Eg4HKcdDi6n+xSRqFNJVpg
3 changed files with 7 additions and 0 deletions

View file

@ -60,6 +60,7 @@ static const std::unordered_map<eWindowRuleEffect, std::string> EFFECT_STRINGS =
{WINDOW_RULE_EFFECT_NO_VRR, "no_vrr"}, //
{WINDOW_RULE_EFFECT_SCROLL_MOUSE, "scroll_mouse"}, //
{WINDOW_RULE_EFFECT_SCROLL_TOUCHPAD, "scroll_touchpad"}, //
{WINDOW_RULE_EFFECT_STAY_FOCUSED, "stay_focused"}, //
};
std::optional<eWindowRuleEffect> Rule::matchWindowEffectFromString(const std::string_view& s) {

View file

@ -67,6 +67,7 @@ namespace Desktop::Rule {
WINDOW_RULE_EFFECT_NO_VRR,
WINDOW_RULE_EFFECT_SCROLL_MOUSE,
WINDOW_RULE_EFFECT_SCROLL_TOUCHPAD,
WINDOW_RULE_EFFECT_STAY_FOCUSED,
};
std::optional<Vector2D> parseRelativeVector(PHLWINDOW w, const std::string& s);

View file

@ -396,6 +396,11 @@ CWindowRuleApplicator::SRuleResult CWindowRuleApplicator::applyDynamicRule(const
m_noVRR.second |= rule->getPropertiesMask();
break;
}
case WINDOW_RULE_EFFECT_STAY_FOCUSED: {
m_stayFocused.first.set(truthy(effect), Types::PRIORITY_WINDOW_RULE);
m_stayFocused.second |= rule->getPropertiesMask();
break;
}
case WINDOW_RULE_EFFECT_SCROLL_MOUSE: {
try {
m_scrollMouse.first.set(std::clamp(std::stof(effect), 0.01F, 10.F), Types::PRIORITY_WINDOW_RULE);