summaryrefslogtreecommitdiff
path: root/hyprtester/src/tests/main/workspaces.cpp
diff options
context:
space:
mode:
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"));