From 8b78de5d90cb81ebf01df1c84ca205b22aced7d1 Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Fri, 8 May 2026 23:22:07 +0100 Subject: compositor: recalculate workspace state after fs state update (#14369) --- hyprtester/src/tests/main/window.cpp | 51 +++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) (limited to 'hyprtester/src/tests/main/window.cpp') diff --git a/hyprtester/src/tests/main/window.cpp b/hyprtester/src/tests/main/window.cpp index bb5e0f20..0b1b4248 100644 --- a/hyprtester/src/tests/main/window.cpp +++ b/hyprtester/src/tests/main/window.cpp @@ -1123,4 +1123,53 @@ TEST_CASE(cycle_nextFloating) { OK(getFromSocket("/dispatch hl.dsp.window.cycle_next({ next = true, tiled = false, floating = true})")); ASSERT_CONTAINS(getFromSocket("/activewindow"), "class: b"); -} \ No newline at end of file +} + +TEST_CASE(discussion14233) { + // toggling fullscreen should not mess up workspace state on a 2 window workspace + // with smart gaps + + OK(getFromSocket(R"#(/eval hl.workspace_rule({ workspace = "w[tv1]", gaps_out = 0, gaps_in = 0 }) +hl.workspace_rule({ workspace = "f[1]", gaps_out = 0, gaps_in = 0 }) +hl.window_rule({ + name = "no-gaps-wtv1", + match = { float = false, workspace = "w[tv1]" }, + border_size = 0, + rounding = 0, +}) +hl.window_rule({ + name = "no-gaps-f1", + match = { float = false, workspace = "f[1]" }, + border_size = 0, + rounding = 0, +}) +)#")); + + ASSERT(!!Tests::spawnKitty(), true); + + // just make sure smart gaps work + { + auto str = getFromSocket("/clients"); + ASSERT_CONTAINS(str, "size: 1920,1080"); + ASSERT_CONTAINS(str, "at: 0,0"); + } + + ASSERT(!!Tests::spawnKitty(), true); + + { + auto str = getFromSocket("/clients"); + ASSERT_COUNT_STRING(str, "size: 931,1036", 2); + ASSERT_CONTAINS(str, "at: 22,22"); + ASSERT_CONTAINS(str, "at: 967,22"); + } + + OK(getFromSocket("/dispatch hl.dsp.window.fullscreen()")); + OK(getFromSocket("/dispatch hl.dsp.window.fullscreen()")); + + { + auto str = getFromSocket("/clients"); + ASSERT_COUNT_STRING(str, "size: 931,1036", 2); + ASSERT_CONTAINS(str, "at: 22,22"); + ASSERT_CONTAINS(str, "at: 967,22"); + } +} -- cgit v1.2.3