From be03497b82be332a124dd170e8741623791ef7c4 Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Mon, 2 Mar 2026 21:39:06 +0000 Subject: layout/algos: use binds:window_direction_monitor_fallback for moves (#13508) ref https://github.com/hyprwm/Hyprland/discussions/13473 --- hyprtester/src/tests/main/workspaces.cpp | 121 +++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) (limited to 'hyprtester/src/tests/main/workspaces.cpp') diff --git a/hyprtester/src/tests/main/workspaces.cpp b/hyprtester/src/tests/main/workspaces.cpp index a126d1b2..788b2357 100644 --- a/hyprtester/src/tests/main/workspaces.cpp +++ b/hyprtester/src/tests/main/workspaces.cpp @@ -255,6 +255,126 @@ static void testMultimonBAF() { Tests::killAllWindows(); } +static void testMultimonFocus() { + NLog::log("{}Testing multimon focus and move", Colors::YELLOW); + + OK(getFromSocket("/keyword input:follow_mouse 0")); + OK(getFromSocket("/dispatch focusmonitor HEADLESS-3")); + OK(getFromSocket("/dispatch workspace 8")); + OK(getFromSocket("/dispatch focusmonitor HEADLESS-2")); + OK(getFromSocket("/dispatch workspace 7")); + + for (auto const& win : {"a", "b"}) { + 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:a")); + OK(getFromSocket("/dispatch movefocus r")); + + { + auto str = getFromSocket("/activeworkspace"); + EXPECT_CONTAINS(str, "workspace ID 7 "); + } + + { + auto str = getFromSocket("/activewindow"); + EXPECT_CONTAINS(str, "class: b"); + } + + OK(getFromSocket("/dispatch movefocus r")); + + { + auto str = getFromSocket("/activeworkspace"); + EXPECT_CONTAINS(str, "workspace ID 8 "); + } + + Tests::spawnKitty("c"); + + { + auto str = getFromSocket("/activewindow"); + EXPECT_CONTAINS(str, "class: c"); + } + + { + auto str = getFromSocket("/activeworkspace"); + EXPECT_CONTAINS(str, "workspace ID 8 "); + } + + OK(getFromSocket("/dispatch movefocus l")); + + { + auto str = getFromSocket("/activewindow"); + EXPECT_CONTAINS(str, "class: b"); + } + + { + auto str = getFromSocket("/activeworkspace"); + EXPECT_CONTAINS(str, "workspace ID 7 "); + } + + OK(getFromSocket("/dispatch movewindow r")); + + { + auto str = getFromSocket("/activewindow"); + EXPECT_CONTAINS(str, "class: b"); + } + + { + auto str = getFromSocket("/activeworkspace"); + EXPECT_CONTAINS(str, "workspace ID 8 "); + } + + OK(getFromSocket("/dispatch movefocus r")); + + { + auto str = getFromSocket("/activewindow"); + EXPECT_CONTAINS(str, "class: c"); + } + + { + auto str = getFromSocket("/activeworkspace"); + EXPECT_CONTAINS(str, "workspace ID 8 "); + } + + OK(getFromSocket("/dispatch movefocus l")); + + OK(getFromSocket("/keyword general:no_focus_fallback true")); + OK(getFromSocket("/keyword binds:window_direction_monitor_fallback false")); + + OK(getFromSocket("/dispatch movefocus l")); + + { + auto str = getFromSocket("/activewindow"); + EXPECT_CONTAINS(str, "class: b"); + } + + { + auto str = getFromSocket("/activeworkspace"); + EXPECT_CONTAINS(str, "workspace ID 8 "); + } + + OK(getFromSocket("/dispatch movewindow l")); + + { + auto str = getFromSocket("/activewindow"); + EXPECT_CONTAINS(str, "class: b"); + } + + { + auto str = getFromSocket("/activeworkspace"); + EXPECT_CONTAINS(str, "workspace ID 8 "); + } + + OK(getFromSocket("/reload")); + + Tests::killAllWindows(); +} + static bool test() { NLog::log("{}Testing workspaces", Colors::GREEN); @@ -594,6 +714,7 @@ static bool test() { Tests::killAllWindows(); testMultimonBAF(); + testMultimonFocus(); // destroy the headless output OK(getFromSocket("/output remove HEADLESS-3")); -- cgit v1.2.3