summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEvilLary <EvilLary@proton.me>2025-11-25 02:48:10 +0300
committerGitHub <noreply@github.com>2025-11-24 23:48:10 +0000
commit475e87b35173ee1439035a072e7c70e94cb4ad56 (patch)
tree1210964494203d25b82d65e482b4090fb48c0f65 /src
parent3d7ea9c02face0d6c5d9963030a06705268979ba (diff)
windowrules: fix persistent_size not applying (#12441)
Diffstat (limited to 'src')
-rw-r--r--src/desktop/rule/windowRule/WindowRuleApplicator.cpp6
-rw-r--r--src/layout/IHyprLayout.cpp3
2 files changed, 5 insertions, 4 deletions
diff --git a/src/desktop/rule/windowRule/WindowRuleApplicator.cpp b/src/desktop/rule/windowRule/WindowRuleApplicator.cpp
index 14d7fbf1..202587cf 100644
--- a/src/desktop/rule/windowRule/WindowRuleApplicator.cpp
+++ b/src/desktop/rule/windowRule/WindowRuleApplicator.cpp
@@ -130,10 +130,8 @@ CWindowRuleApplicator::SRuleResult CWindowRuleApplicator::applyDynamicRule(const
break;
}
case WINDOW_RULE_EFFECT_PERSISTENT_SIZE: {
- try {
- m_persistentSize.first.set(std::stoi(effect), Types::PRIORITY_WINDOW_RULE);
- m_persistentSize.second |= rule->getPropertiesMask();
- } catch (...) { Debug::log(ERR, "CWindowRuleApplicator::applyDynamicRule: invalid rounding_power {}", effect); }
+ m_persistentSize.first.set(truthy(effect), Types::PRIORITY_WINDOW_RULE);
+ m_persistentSize.second |= rule->getPropertiesMask();
break;
}
case WINDOW_RULE_EFFECT_ANIMATION: {
diff --git a/src/layout/IHyprLayout.cpp b/src/layout/IHyprLayout.cpp
index 953e8e02..18c100b7 100644
--- a/src/layout/IHyprLayout.cpp
+++ b/src/layout/IHyprLayout.cpp
@@ -108,6 +108,9 @@ void IHyprLayout::onWindowCreatedFloating(PHLWINDOW pWindow) {
xy = g_pXWaylandManager->xwaylandToWaylandCoords(xy);
desiredGeometry.x = xy.x;
desiredGeometry.y = xy.y;
+ } else if (pWindow->m_ruleApplicator->persistentSize().valueOrDefault()) {
+ desiredGeometry.w = pWindow->m_lastFloatingSize.x;
+ desiredGeometry.h = pWindow->m_lastFloatingSize.y;
}
static auto PXWLFORCESCALEZERO = CConfigValue<Hyprlang::INT>("xwayland:force_zero_scaling");