diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2025-11-20 16:57:31 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-20 16:57:31 +0000 |
| commit | c249a9f4b8940d7356b756dc639f9cb18713e088 (patch) | |
| tree | 590c1bd3aaba5217595c3138b566fa7bd8bbf0b9 /hyprtester/src/tests/main/window.cpp | |
| parent | 00cce1c8ffa1be75dd94de83063d179b45c0831f (diff) | |
windowrules: fix group rule recalcs (#12403)
Diffstat (limited to 'hyprtester/src/tests/main/window.cpp')
| -rw-r--r-- | hyprtester/src/tests/main/window.cpp | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/hyprtester/src/tests/main/window.cpp b/hyprtester/src/tests/main/window.cpp index 87187592..982c0ef3 100644 --- a/hyprtester/src/tests/main/window.cpp +++ b/hyprtester/src/tests/main/window.cpp @@ -131,6 +131,68 @@ static void testSwapWindow() { EXPECT(Tests::windowCount(), 0); } +static void testGroupRules() { + NLog::log("{}Testing group window rules", Colors::YELLOW); + + OK(getFromSocket("/keyword general:border_size 8")); + OK(getFromSocket("/keyword workspace w[tv1], bordersize:0")); + OK(getFromSocket("/keyword workspace f[1], bordersize:0")); + OK(getFromSocket("/keyword windowrule match:workspace w[tv1], border_size 0")); + OK(getFromSocket("/keyword windowrule match:workspace f[1], border_size 0")); + + if (!Tests::spawnKitty("kitty_A")) { + ret = 1; + return; + } + + { + auto str = getFromSocket("/getprop active border_size"); + EXPECT_CONTAINS(str, "0"); + } + + if (!Tests::spawnKitty("kitty_B")) { + ret = 1; + return; + } + + { + auto str = getFromSocket("/getprop active border_size"); + EXPECT_CONTAINS(str, "8"); + } + + OK(getFromSocket("/dispatch focuswindow class:kitty_A")); + OK(getFromSocket("/dispatch togglegroup")); + OK(getFromSocket("/dispatch focuswindow class:kitty_B")); + OK(getFromSocket("/dispatch moveintogroup l")); + + { + auto str = getFromSocket("/getprop active border_size"); + EXPECT_CONTAINS(str, "0"); + } + + OK(getFromSocket("/dispatch changegroupactive f")); + + { + auto str = getFromSocket("/getprop active border_size"); + EXPECT_CONTAINS(str, "0"); + } + + if (!Tests::spawnKitty("kitty_C")) { + ret = 1; + return; + } + + OK(getFromSocket("/dispatch moveoutofgroup r")); + + { + auto str = getFromSocket("/getprop active border_size"); + EXPECT_CONTAINS(str, "8"); + } + + OK(getFromSocket("/reload")); + Tests::killAllWindows(); +} + static bool test() { NLog::log("{}Testing windows", Colors::GREEN); @@ -403,6 +465,11 @@ static bool test() { OK(getFromSocket("/dispatch plugin:test:check_rule")); + OK(getFromSocket("/reload")); + Tests::killAllWindows(); + + testGroupRules(); + NLog::log("{}Reloading config", Colors::YELLOW); OK(getFromSocket("/reload")); |
