From b0f6ac23b26e62f650d3b26dfb0aa7eb15e29da8 Mon Sep 17 00:00:00 2001 From: Mr-Stoneman <72991726+Mr-Stoneman@users.noreply.github.com> Date: Thu, 26 Mar 2026 22:38:39 +0100 Subject: desktop/workspaceHistory: small refactor to work better with multi monitor setups (#13632) --- hyprtester/src/tests/main/workspaces.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'hyprtester/src/tests/main/workspaces.cpp') diff --git a/hyprtester/src/tests/main/workspaces.cpp b/hyprtester/src/tests/main/workspaces.cpp index 122cd619..f7c948f2 100644 --- a/hyprtester/src/tests/main/workspaces.cpp +++ b/hyprtester/src/tests/main/workspaces.cpp @@ -193,6 +193,35 @@ static bool testAsymmetricGaps() { return true; } +static void testWorkspaceHistoryMultiMon() { + NLog::log("{}Testing multimon workspace history tracker", Colors::YELLOW); + + // Initial state: + OK(getFromSocket("/dispatch focusmonitor HEADLESS-2")); + OK(getFromSocket("/dispatch workspace 10")); + Tests::spawnKitty(); + OK(getFromSocket("/dispatch workspace 11")); + Tests::spawnKitty(); + + OK(getFromSocket("/dispatch focusmonitor HEADLESS-3")); + OK(getFromSocket("/dispatch workspace 12")); + Tests::spawnKitty(); + + OK(getFromSocket("/dispatch focusmonitor HEADLESS-2")); + { + auto str = getFromSocket("/activeworkspace"); + EXPECT_CONTAINS(str, "workspace ID 11"); + } + OK(getFromSocket("/dispatch workspace previous_per_monitor")); + { + auto str = getFromSocket("/activeworkspace"); + EXPECT_CONTAINS(str, "workspace ID 10"); + } + + NLog::log("{}Killing all windows", Colors::YELLOW); + Tests::killAllWindows(); +} + static void testMultimonBAF() { NLog::log("{}Testing multimon back and forth", Colors::YELLOW); @@ -733,6 +762,7 @@ static bool test() { testMultimonBAF(); testMultimonFocus(); + testWorkspaceHistoryMultiMon(); // destroy the headless output OK(getFromSocket("/output remove HEADLESS-3")); -- cgit v1.2.3