summaryrefslogtreecommitdiff
path: root/hyprtester/src/tests/main/workspaces.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2026-03-02 21:39:06 +0000
committerGitHub <noreply@github.com>2026-03-02 21:39:06 +0000
commitbe03497b82be332a124dd170e8741623791ef7c4 (patch)
tree06758f08e32a6647d43f70184be40fa1a1024074 /hyprtester/src/tests/main/workspaces.cpp
parentff20cbf89c68a87b12c0cd3453ac13d7c7197da5 (diff)
layout/algos: use binds:window_direction_monitor_fallback for moves (#13508)
ref https://github.com/hyprwm/Hyprland/discussions/13473
Diffstat (limited to 'hyprtester/src/tests/main/workspaces.cpp')
-rw-r--r--hyprtester/src/tests/main/workspaces.cpp121
1 files changed, 121 insertions, 0 deletions
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"));