From 8a12d6cf7e3b11ea46e6d76f219b1d1cdde9e797 Mon Sep 17 00:00:00 2001 From: Nikolai Nechaev Date: Tue, 10 Mar 2026 19:04:21 +0900 Subject: algo/dwindle: Respect `force_split` when moving windows to workspaces (#13038) Respect `dwindle:force_split` not only when mapping new windows, but also when moving windows to workspaces. Fixes #13009. --- hyprtester/src/tests/main/dwindle.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'hyprtester/src/tests/main/dwindle.cpp') diff --git a/hyprtester/src/tests/main/dwindle.cpp b/hyprtester/src/tests/main/dwindle.cpp index 5504282d..9513db67 100644 --- a/hyprtester/src/tests/main/dwindle.cpp +++ b/hyprtester/src/tests/main/dwindle.cpp @@ -227,6 +227,28 @@ static void testRotatesplit() { OK(getFromSocket("/reload")); } +static void testForceSplitOnMoveToWorkspace() { + OK(getFromSocket("/dispatch workspace 2")); + EXPECT(!!Tests::spawnKitty("kitty"), true); + + OK(getFromSocket("/dispatch workspace 1")); + EXPECT(!!Tests::spawnKitty("kitty"), true); + std::string posBefore = Tests::getWindowAttribute(getFromSocket("/activewindow"), "at:"); + + OK(getFromSocket("/keyword dwindle:force_split 2")); + OK(getFromSocket("/dispatch movecursortocorner 3")); // top left + OK(getFromSocket("/dispatch movetoworkspace 2")); + + // Should be moved to the right, so the position should change + std::string activeWindow = getFromSocket("/activewindow"); + EXPECT(activeWindow.contains(posBefore), false); + + // clean up + OK(getFromSocket("/reload")); + Tests::killAllWindows(); + Tests::waitUntilWindowsN(0); +} + static bool test() { NLog::log("{}Testing Dwindle layout", Colors::GREEN); @@ -243,6 +265,9 @@ static bool test() { NLog::log("{}Testing rotatesplit", Colors::GREEN); testRotatesplit(); + NLog::log("{}Testing force_split on move to workspace", Colors::GREEN); + testForceSplitOnMoveToWorkspace(); + // clean up NLog::log("Cleaning up", Colors::YELLOW); getFromSocket("/dispatch workspace 1"); -- cgit v1.2.3