desktop/windowRule: allow expression in min_size/max_size (#12977)

This commit is contained in:
Florent Charpentier 2026-01-22 02:56:51 +11:00 committed by GitHub
parent e7985ca4c4
commit 22fc8136a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 48 additions and 10 deletions

View file

@ -970,7 +970,8 @@ static bool test() {
Tests::killAllWindows();
// test expression rules
OK(getFromSocket("/keyword windowrule match:class expr_kitty, float yes, size monitor_w*0.5 monitor_h*0.5, move 20+(monitor_w*0.1) monitor_h*0.5"));
OK(getFromSocket("/keyword windowrule match:class expr_kitty, float yes, size monitor_w*0.5 monitor_h*0.5, min_size monitor_w*0.25 monitor_h*0.25, "
"max_size monitor_w*0.75 monitor_h*0.75, move 20+(monitor_w*0.1) monitor_h*0.5"));
if (!spawnKitty("expr_kitty"))
return false;
@ -980,6 +981,14 @@ static bool test() {
EXPECT_CONTAINS(str, "floating: 1");
EXPECT_CONTAINS(str, "at: 212,540");
EXPECT_CONTAINS(str, "size: 960,540");
auto min = getFromSocket("/getprop active min_size");
EXPECT_CONTAINS(min, "480");
EXPECT_CONTAINS(min, "270");
auto max = getFromSocket("/getprop active max_size");
EXPECT_CONTAINS(max, "1440");
EXPECT_CONTAINS(max, "810");
}
OK(getFromSocket("/reload"));