diff options
| -rw-r--r-- | hyprtester/src/tests/main/window.cpp | 51 | ||||
| -rw-r--r-- | src/Compositor.cpp | 5 |
2 files changed, 55 insertions, 1 deletions
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"); + } +} diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 4c1861e4..73625068 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -2310,6 +2310,11 @@ void CCompositor::setWindowFullscreenState(const PHLWINDOW PWINDOW, Desktop::Vie PWINDOW->sendWindowSize(true); + // recheck the work area again because visibility checks report 1 window on fs / maximize as tiled + visible + // because the windows below fs are not visible obviously but because we update fullscreen fade which sets that + // state later, it does it wrong + PWORKSPACE->updateWindows(); + PWORKSPACE->m_space->recalculate(); PWORKSPACE->forceReportSizesToWindows(); g_pInputManager->recheckIdleInhibitorStatus(); |
