diff options
| author | justin4046 <71111866+justin4046@users.noreply.github.com> | 2026-03-05 09:14:05 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-05 15:14:05 +0000 |
| commit | 4c60d9df70c67b1d74388c69b46374e46371ff1f (patch) | |
| tree | 1d6e40832091197a7e904e044f5761d4c2e80b5e /hyprtester/src/tests/main/window.cpp | |
| parent | b7dfb47566c3c111573ef9dc6293a764bc92c1e7 (diff) | |
desktop/rules: fix empty workspace handling (#13544)
Diffstat (limited to 'hyprtester/src/tests/main/window.cpp')
| -rw-r--r-- | hyprtester/src/tests/main/window.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/hyprtester/src/tests/main/window.cpp b/hyprtester/src/tests/main/window.cpp index 61263622..2bded63a 100644 --- a/hyprtester/src/tests/main/window.cpp +++ b/hyprtester/src/tests/main/window.cpp @@ -613,6 +613,51 @@ static bool testPinnedWorkspacesValid() { return true; } +static bool testWindowRuleWorkspaceEmpty() { + NLog::log("{}Testing windowrule workspace empty", Colors::YELLOW); + OK(getFromSocket("/reload")); + + OK(getFromSocket("/keyword windowrule match:class kitty_A, workspace empty")); + OK(getFromSocket("/keyword windowrule match:class kitty_B, workspace emptyn")); + + getFromSocket("/dispatch workspace 3"); + + if (!spawnKitty("kitty")) { + NLog::log("{}Error: failed to spawn kitty", Colors::RED); + return false; + } + + { + auto str = getFromSocket("/activewindow"); + EXPECT(str.contains("workspace: 3"), true); + } + + if (!spawnKitty("kitty_A")) { + NLog::log("{}Error: failed to spawn kitty", Colors::RED); + return false; + } + + { + auto str = getFromSocket("/activewindow"); + EXPECT(str.contains("workspace: 1"), true); + } + + getFromSocket("/dispatch workspace 3"); + if (!spawnKitty("kitty_B")) { + NLog::log("{}Error: failed to spawn kitty", Colors::RED); + return false; + } + + { + auto str = getFromSocket("/activewindow"); + EXPECT(str.contains("workspace: 4"), true); + } + + Tests::killAllWindows(); + + return true; +} + static bool test() { NLog::log("{}Testing windows", Colors::GREEN); @@ -1076,6 +1121,7 @@ static bool test() { testInitialFloatSize(); testWindowRuleFocusOnActivate(); testPinnedWorkspacesValid(); + testWindowRuleWorkspaceEmpty(); NLog::log("{}Reloading config", Colors::YELLOW); OK(getFromSocket("/reload")); |
