mirror of
https://github.com/hyprwm/Hyprland
synced 2025-12-20 07:10:02 +01:00
windowrules: fix persistent_size not applying (#12441)
This commit is contained in:
parent
3d7ea9c02f
commit
475e87b351
3 changed files with 33 additions and 4 deletions
|
|
@ -397,6 +397,34 @@ static bool test() {
|
|||
OK(getFromSocket("/reload"));
|
||||
Tests::killAllWindows();
|
||||
|
||||
// test persistent_size between floating window launches
|
||||
OK(getFromSocket("/keyword windowrule match:class persistent_size_kitty, persistent_size true, float true"));
|
||||
|
||||
if (!spawnKitty("persistent_size_kitty"))
|
||||
return false;
|
||||
|
||||
OK(getFromSocket("/dispatch resizeactive exact 600 400"))
|
||||
|
||||
{
|
||||
auto str = getFromSocket("/activewindow");
|
||||
EXPECT_CONTAINS(str, "size: 600,400");
|
||||
EXPECT_CONTAINS(str, "floating: 1");
|
||||
}
|
||||
|
||||
Tests::killAllWindows();
|
||||
|
||||
if (!spawnKitty("persistent_size_kitty"))
|
||||
return false;
|
||||
|
||||
{
|
||||
auto str = getFromSocket("/activewindow");
|
||||
EXPECT_CONTAINS(str, "size: 600,400");
|
||||
EXPECT_CONTAINS(str, "floating: 1");
|
||||
}
|
||||
|
||||
OK(getFromSocket("/reload"));
|
||||
Tests::killAllWindows();
|
||||
|
||||
OK(getFromSocket("/keyword general:border_size 0"));
|
||||
OK(getFromSocket("/keyword windowrule match:float true, border_size 10"));
|
||||
|
||||
|
|
|
|||
|
|
@ -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: {
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue