From 0e9196867b4f602e1e5a599d4f3565faff615b3c Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Thu, 26 Feb 2026 12:00:05 +0000 Subject: algo/dwindle: fix focal point not being properly used in movedTarget (#13373) --- hyprtester/src/tests/main/dwindle.cpp | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'hyprtester/src/tests/main/dwindle.cpp') diff --git a/hyprtester/src/tests/main/dwindle.cpp b/hyprtester/src/tests/main/dwindle.cpp index 8f17c815..4135f2d6 100644 --- a/hyprtester/src/tests/main/dwindle.cpp +++ b/hyprtester/src/tests/main/dwindle.cpp @@ -34,6 +34,51 @@ static void testFloatClamp() { // clean up NLog::log("{}Killing all windows", Colors::YELLOW); Tests::killAllWindows(); + + OK(getFromSocket("/reload")); +} + +static void test13349() { + + // Test if dwindle properly uses a focal point to place a new window. + // exposed by #13349 as a regression from #12890 + + for (auto const& win : {"a", "b", "c"}) { + if (!Tests::spawnKitty(win)) { + NLog::log("{}Failed to spawn kitty with win class `{}`", Colors::RED, win); + ++TESTS_FAILED; + ret = 1; + return; + } + } + + OK(getFromSocket("/dispatch focuswindow class:c")); + + { + auto str = getFromSocket("/activewindow"); + EXPECT_CONTAINS(str, "at: 967,547"); + EXPECT_CONTAINS(str, "size: 931,511"); + } + + OK(getFromSocket("/dispatch movewindow l")); + + { + auto str = getFromSocket("/activewindow"); + EXPECT_CONTAINS(str, "at: 22,547"); + EXPECT_CONTAINS(str, "size: 931,511"); + } + + OK(getFromSocket("/dispatch movewindow r")); + + { + auto str = getFromSocket("/activewindow"); + EXPECT_CONTAINS(str, "at: 967,547"); + EXPECT_CONTAINS(str, "size: 931,511"); + } + + // clean up + NLog::log("{}Killing all windows", Colors::YELLOW); + Tests::killAllWindows(); } static bool test() { @@ -43,6 +88,9 @@ static bool test() { NLog::log("{}Testing float clamp", Colors::GREEN); testFloatClamp(); + NLog::log("{}Testing #13349", Colors::GREEN); + test13349(); + // clean up NLog::log("Cleaning up", Colors::YELLOW); getFromSocket("/dispatch workspace 1"); -- cgit v1.2.3