summaryrefslogtreecommitdiff
path: root/hyprtester/src/tests/main/groups.cpp
diff options
context:
space:
mode:
authorAndré Silva <123550+andresilva@users.noreply.github.com>2026-03-03 20:56:02 +0000
committerGitHub <noreply@github.com>2026-03-03 20:56:02 +0000
commitedf7098345b4498e937d25ace9d9b535c0eade34 (patch)
treeef98d600d717435bb819bae1d7e7131be392d652 /hyprtester/src/tests/main/groups.cpp
parent7299a3b0d5332da030e980e60b0ee35b93387cff (diff)
desktop/window: fix floating windows being auto-grouped (#13475)
--------- Co-authored-by: Aqa-Ib <16420574+Aqa-Ib@users.noreply.github.com>
Diffstat (limited to 'hyprtester/src/tests/main/groups.cpp')
-rw-r--r--hyprtester/src/tests/main/groups.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/hyprtester/src/tests/main/groups.cpp b/hyprtester/src/tests/main/groups.cpp
index c1309cc0..2f9c5062 100644
--- a/hyprtester/src/tests/main/groups.cpp
+++ b/hyprtester/src/tests/main/groups.cpp
@@ -254,6 +254,46 @@ static bool test() {
EXPECT(Tests::windowCount(), 0);
}
+ // test that we deny a floated window getting auto-grouped into a tiled group.
+ NLog::log("{}Test that we deny a floated window getting auto-grouped into a tiled group.", Colors::GREEN);
+
+ OK(getFromSocket("/keyword windowrule[kitty-tiled]:match:class kitty_tiled"));
+ OK(getFromSocket("/keyword windowrule[kitty-tiled]:tile yes"));
+ auto kittyProcE = Tests::spawnKitty("kitty_tiled");
+ if (!kittyProcE) {
+ NLog::log("{}Error: kitty did not spawn", Colors::RED);
+ return false;
+ }
+ OK(getFromSocket("/dispatch togglegroup"));
+
+ OK(getFromSocket("/keyword windowrule[kitty-floated]:match:class kitty_floated"));
+ OK(getFromSocket("/keyword windowrule[kitty-floated]:float yes"));
+ auto kittyProcF = Tests::spawnKitty("kitty_floated");
+ if (!kittyProcF) {
+ NLog::log("{}Error: kitty did not spawn", Colors::RED);
+ return false;
+ }
+
+ EXPECT(Tests::windowCount(), 2);
+
+ {
+ auto clients = getFromSocket("/clients");
+ auto classPos = clients.find("class: kitty_floated");
+ if (classPos == std::string::npos) {
+ NLog::log("{}Could not find kitty_floated in clients output", Colors::RED);
+ ret = 1;
+ } else {
+ auto entryStart = clients.rfind("Window ", classPos);
+ auto entryEnd = clients.find("\n\n", classPos);
+ auto windowEntry = clients.substr(entryStart, entryEnd - entryStart);
+ EXPECT_CONTAINS(windowEntry, "floating: 1");
+ EXPECT_CONTAINS(windowEntry, "grouped: 0");
+ }
+ }
+
+ Tests::killAllWindows();
+ EXPECT(Tests::windowCount(), 0);
+
return !ret;
}