diff options
| author | André Silva <123550+andresilva@users.noreply.github.com> | 2026-03-02 21:12:27 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-02 21:12:27 +0000 |
| commit | fe0a20213783a3dcedb4ad30e79e5a6cc9dc3d75 (patch) | |
| tree | dc802acd1b2de549d762a55a21d5c2c7694dd247 /hyprtester | |
| parent | 75a815fbf28b73f3b9f9b9246ed3eb1fbd9b2a58 (diff) | |
desktop/group: respect direction when moving window out of group (#13490)
Diffstat (limited to 'hyprtester')
| -rw-r--r-- | hyprtester/src/tests/main/dwindle.cpp | 8 | ||||
| -rw-r--r-- | hyprtester/src/tests/main/groups.cpp | 53 |
2 files changed, 57 insertions, 4 deletions
diff --git a/hyprtester/src/tests/main/dwindle.cpp b/hyprtester/src/tests/main/dwindle.cpp index cb645245..664a8d73 100644 --- a/hyprtester/src/tests/main/dwindle.cpp +++ b/hyprtester/src/tests/main/dwindle.cpp @@ -64,16 +64,16 @@ static void test13349() { { auto str = getFromSocket("/activewindow"); - EXPECT_CONTAINS(str, "at: 22,547"); - EXPECT_CONTAINS(str, "size: 931,511"); + EXPECT_CONTAINS(str, "at: 497,22"); + EXPECT_CONTAINS(str, "size: 456,1036"); } OK(getFromSocket("/dispatch movewindow r")); { auto str = getFromSocket("/activewindow"); - EXPECT_CONTAINS(str, "at: 967,547"); - EXPECT_CONTAINS(str, "size: 931,511"); + EXPECT_CONTAINS(str, "at: 967,22"); + EXPECT_CONTAINS(str, "size: 456,1036"); } // clean up diff --git a/hyprtester/src/tests/main/groups.cpp b/hyprtester/src/tests/main/groups.cpp index 6e7375ef..c1309cc0 100644 --- a/hyprtester/src/tests/main/groups.cpp +++ b/hyprtester/src/tests/main/groups.cpp @@ -201,6 +201,59 @@ static bool test() { NLog::log("{}Expecting 0 windows", Colors::YELLOW); EXPECT(Tests::windowCount(), 0); + // test movewindoworgroup: direction should be respected when extracting from group + NLog::log("{}Test movewindoworgroup respects direction out of group", Colors::YELLOW); + OK(getFromSocket("/keyword group:groupbar:enabled 0")); + { + auto kittyE = Tests::spawnKitty(); + if (!kittyE) { + NLog::log("{}Error: kitty did not spawn", Colors::RED); + return false; + } + + // group kitty, and new windows should be auto-grouped + OK(getFromSocket("/dispatch togglegroup")); + + auto kittyF = Tests::spawnKitty(); + if (!kittyF) { + NLog::log("{}Error: kitty did not spawn", Colors::RED); + return false; + } + EXPECT(Tests::windowCount(), 2); + + // both windows should be grouped at the same position + { + auto str = getFromSocket("/clients"); + EXPECT_COUNT_STRING(str, "at: 22,22", 2); + } + + // move active window out of group to the right + NLog::log("{}Test movewindoworgroup r", Colors::YELLOW); + OK(getFromSocket("/dispatch movewindoworgroup r")); + + // the group should stay at x=22, the extracted window should be to the right + { + auto str = getFromSocket("/clients"); + EXPECT_COUNT_STRING(str, "at: 22,22", 1); + } + + // move it back into the group + OK(getFromSocket("/dispatch moveintogroup l")); + + // move active window out of group downward + NLog::log("{}Test movewindoworgroup d", Colors::YELLOW); + OK(getFromSocket("/dispatch movewindoworgroup d")); + + // the group should stay at y=22, the extracted window should be below + { + auto str = getFromSocket("/clients"); + EXPECT_COUNT_STRING(str, "at: 22,22", 1); + } + + Tests::killAllWindows(); + EXPECT(Tests::windowCount(), 0); + } + return !ret; } |
