summaryrefslogtreecommitdiff
path: root/hyprtester/src/tests/main/layout.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2026-04-12 18:04:56 +0100
committerGitHub <noreply@github.com>2026-04-12 18:04:56 +0100
commitd67c4e2b7f1e381b24becbb45b8e8471fcdda163 (patch)
tree510a1626babdc5ba4acc37f37f0ec643ab4b9512 /hyprtester/src/tests/main/layout.cpp
parent24b121c7a3df5d4d5d44f19d6e4129ea82fdfc1e (diff)
layout/algo: preserve focused target if applicable on layout switches (#14058)
fixes #13804
Diffstat (limited to 'hyprtester/src/tests/main/layout.cpp')
-rw-r--r--hyprtester/src/tests/main/layout.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/hyprtester/src/tests/main/layout.cpp b/hyprtester/src/tests/main/layout.cpp
index 5be29a6f..208bee30 100644
--- a/hyprtester/src/tests/main/layout.cpp
+++ b/hyprtester/src/tests/main/layout.cpp
@@ -140,6 +140,31 @@ static bool testFocusMRUAfterClose() {
return true;
}
+static bool testFocusPreservedLayoutChange() {
+ NLog::log("{}Testing focus is preserved on layout change", Colors::GREEN);
+
+ OK(getFromSocket("/keyword general:layout master"));
+
+ EXPECT(!!Tests::spawnKitty("kitty_A"), true);
+ EXPECT(!!Tests::spawnKitty("kitty_B"), true);
+ EXPECT(!!Tests::spawnKitty("kitty_C"), true);
+ EXPECT(!!Tests::spawnKitty("kitty_D"), true);
+
+ OK(getFromSocket("/dispatch focuswindow class:kitty_C"));
+
+ OK(getFromSocket("/keyword general:layout monocle"));
+
+ {
+ auto str = getFromSocket("/activewindow");
+ EXPECT(str.contains("class: kitty_C"), true);
+ }
+
+ NLog::log("{}Killing all windows", Colors::YELLOW);
+ Tests::killAllWindows();
+ EXPECT(Tests::windowCount(), 0);
+ return true;
+}
+
static bool test() {
NLog::log("{}Testing layout generic", Colors::GREEN);
@@ -153,6 +178,7 @@ static bool test() {
testCrashOnGeomUpdate();
testPosPreserve();
testFocusMRUAfterClose();
+ testFocusPreservedLayoutChange();
// clean up
NLog::log("Cleaning up", Colors::YELLOW);