From d6aa6af5b3b3cc7c086423cb12c6f2bb76bd15c2 Mon Sep 17 00:00:00 2001 From: Maxim Andreev Date: Tue, 5 May 2026 19:31:09 +0400 Subject: groups: add groupbar middle_click_close option (#14242) --- hyprtester/src/tests/main/groups.cpp | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'hyprtester/src/tests/main/groups.cpp') diff --git a/hyprtester/src/tests/main/groups.cpp b/hyprtester/src/tests/main/groups.cpp index e1d4dd9b..aeb43330 100644 --- a/hyprtester/src/tests/main/groups.cpp +++ b/hyprtester/src/tests/main/groups.cpp @@ -400,4 +400,43 @@ TEST_CASE(groups) { Tests::killAllWindows(); ASSERT(Tests::windowCount(), 0); + + // Test groupbar middle click close config + { + OK(getFromSocket("/eval hl.config({ group = { auto_group = true, groupbar = { enabled = true, middle_click_close = false } } })")); + + auto kittyA = Tests::spawnKitty("kittyA"); + if (!kittyA) { + FAIL_TEST("Could not spawn kitty"); + } + + OK(getFromSocket("/dispatch hl.dsp.group.toggle()")); + + auto kittyB = Tests::spawnKitty("kittyB"); + if (!kittyB) { + FAIL_TEST("Could not spawn kitty"); + } + + EXPECT(Tests::windowCount(), 2); + + OK(getFromSocket("/dispatch hl.dsp.cursor.move({ x = 80, y = 32 })")); + OK(getFromSocket("/eval hl.plugin.test.click(274, 1)")); + OK(getFromSocket("/eval hl.plugin.test.click(274, 0)")); + + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + EXPECT(Tests::windowCount(), 2); + + OK(getFromSocket("/eval hl.config({ group = { groupbar = { middle_click_close = true } } })")); + OK(getFromSocket("/dispatch hl.dsp.cursor.move({ x = 80, y = 32 })")); + OK(getFromSocket("/eval hl.plugin.test.click(274, 1)")); + OK(getFromSocket("/eval hl.plugin.test.click(274, 0)")); + + Tests::waitUntilWindowsN(1); + EXPECT(Tests::windowCount(), 1); + + OK(getFromSocket("/eval hl.config({ group = { groupbar = { enabled = 0 } } })")); + } + + Tests::killAllWindows(); + ASSERT(Tests::windowCount(), 0); } -- cgit v1.2.3