From 31d3181e1ee91e338fb4fb8207d64b8d689310fc Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Thu, 1 Jan 2026 21:49:57 +0100 Subject: dekstop/window: read static rules before guessing initial size if possible (#12783) --- hyprtester/src/tests/main/window.cpp | 37 +++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) (limited to 'hyprtester/src/tests/main/window.cpp') diff --git a/hyprtester/src/tests/main/window.cpp b/hyprtester/src/tests/main/window.cpp index 0a2e31d0..fbaffa18 100644 --- a/hyprtester/src/tests/main/window.cpp +++ b/hyprtester/src/tests/main/window.cpp @@ -447,6 +447,39 @@ static void testBringActiveToTopMouseMovement() { Tests::killAllWindows(); } +static void testInitialFloatSize() { + NLog::log("{}Testing initial float size", Colors::GREEN); + + Tests::killAllWindows(); + OK(getFromSocket("/keyword windowrule match:class kitty, float yes")); + OK(getFromSocket("/keyword input:float_switch_override_focus 0")); + + EXPECT(spawnKitty("kitty"), true); + + { + // Kitty by default opens as 640x400, if this changes this test will break + auto str = getFromSocket("/clients"); + EXPECT(str.contains("size: 640,400"), true); + } + + OK(getFromSocket("/reload")); + + Tests::killAllWindows(); + + OK(getFromSocket("/dispatch exec [float yes]kitty")); + + Tests::waitUntilWindowsN(1); + + { + // Kitty by default opens as 640x400, if this changes this test will break + auto str = getFromSocket("/clients"); + EXPECT(str.contains("size: 640,400"), true); + EXPECT(str.contains("floating: 1"), true); + } + + Tests::killAllWindows(); +} + static bool test() { NLog::log("{}Testing windows", Colors::GREEN); @@ -877,12 +910,10 @@ static bool test() { Tests::killAllWindows(); testGroupRules(); - testMaximizeSize(); - testBringActiveToTopMouseMovement(); - testGroupFallbackFocus(); + testInitialFloatSize(); NLog::log("{}Reloading config", Colors::YELLOW); OK(getFromSocket("/reload")); -- cgit v1.2.3