From 1e06ab464ff1aa1e8d3f79b4aa702cab101edfb0 Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Wed, 25 Feb 2026 23:54:13 +0000 Subject: algo/master: fix orientation cycling (#13372) --- hyprtester/src/tests/main/master.cpp | 50 +++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) (limited to 'hyprtester/src/tests/main/master.cpp') diff --git a/hyprtester/src/tests/main/master.cpp b/hyprtester/src/tests/main/master.cpp index 9cd20e83..441143ac 100644 --- a/hyprtester/src/tests/main/master.cpp +++ b/hyprtester/src/tests/main/master.cpp @@ -3,7 +3,53 @@ #include "../../hyprctlCompat.hpp" #include "tests.hpp" -static int ret = 0; +static int ret = 0; + +// reqs 1 master 3 slaves +static void testOrientations() { + OK(getFromSocket("/keyword master:orientation top")); + + // top + { + auto str = getFromSocket("/activewindow"); + EXPECT_CONTAINS(str, "at: 22,22"); + EXPECT_CONTAINS(str, "size: 1876"); + } + + // cycle = top, right, bottom, center, left + + // right + OK(getFromSocket("/dispatch layoutmsg orientationnext")); + { + auto str = getFromSocket("/activewindow"); + EXPECT_CONTAINS(str, "at: 873,22"); + EXPECT_CONTAINS(str, "size: 1025,1036"); + } + + // bottom + OK(getFromSocket("/dispatch layoutmsg orientationnext")); + { + auto str = getFromSocket("/activewindow"); + EXPECT_CONTAINS(str, "at: 22,495"); + EXPECT_CONTAINS(str, "size: 1876"); + } + + // center + OK(getFromSocket("/dispatch layoutmsg orientationnext")); + { + auto str = getFromSocket("/activewindow"); + EXPECT_CONTAINS(str, "at: 450,22"); + EXPECT_CONTAINS(str, "size: 1020,1036"); + } + + // left + OK(getFromSocket("/dispatch layoutmsg orientationnext")); + { + auto str = getFromSocket("/activewindow"); + EXPECT_CONTAINS(str, "at: 22,22"); + EXPECT_CONTAINS(str, "size: 1025,1036"); + } +} static void focusMasterPrevious() { // setup @@ -44,6 +90,8 @@ static void focusMasterPrevious() { OK(getFromSocket("/dispatch layoutmsg focusmaster previous")); EXPECT_CONTAINS(getFromSocket("/activewindow"), "class: master"); + testOrientations(); + // clean up NLog::log("{}Killing all windows", Colors::YELLOW); Tests::killAllWindows(); -- cgit v1.2.3