From 475e87b35173ee1439035a072e7c70e94cb4ad56 Mon Sep 17 00:00:00 2001 From: EvilLary Date: Tue, 25 Nov 2025 02:48:10 +0300 Subject: windowrules: fix persistent_size not applying (#12441) --- src/desktop/rule/windowRule/WindowRuleApplicator.cpp | 6 ++---- src/layout/IHyprLayout.cpp | 3 +++ 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src') 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("xwayland:force_zero_scaling"); -- cgit v1.2.3