From 40d8fa84919c6d0e9fcb1536f4bc09710d4c031c Mon Sep 17 00:00:00 2001 From: Nikolai Nechaev Date: Wed, 26 Nov 2025 07:44:26 +0900 Subject: compositor: Configurable behavior when window to be focused conflicts with fullscreen (#12033) Renames `misc:new_window_takes_over_fullscreen` into `misc:on_focus_under_fullscreen` and implements the following behavior: - By default, when a tiling window is being focused on a workspace where a fullscreen/maximized window exists, respect the `misc:on_focus_under_fullscreen` config variable. --- hyprtester/src/tests/main/misc.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'hyprtester/src/tests/main/misc.cpp') diff --git a/hyprtester/src/tests/main/misc.cpp b/hyprtester/src/tests/main/misc.cpp index d5865f20..3187694b 100644 --- a/hyprtester/src/tests/main/misc.cpp +++ b/hyprtester/src/tests/main/misc.cpp @@ -53,7 +53,7 @@ static bool test() { NLog::log("{}Testing new_window_takes_over_fullscreen", Colors::YELLOW); - OK(getFromSocket("/keyword misc:new_window_takes_over_fullscreen 0")); + OK(getFromSocket("/keyword misc:on_focus_under_fullscreen 0")); Tests::spawnKitty("kitty_A"); @@ -73,7 +73,16 @@ static bool test() { EXPECT_CONTAINS(str, "kitty_A"); } - OK(getFromSocket("/keyword misc:new_window_takes_over_fullscreen 1")); + OK(getFromSocket("/dispatch focuswindow class:kitty_B")); + + { + // should be ignored as per focus_under_fullscreen 0 + auto str = getFromSocket("/activewindow"); + EXPECT_CONTAINS(str, "fullscreen: 2"); + EXPECT_CONTAINS(str, "kitty_A"); + } + + OK(getFromSocket("/keyword misc:on_focus_under_fullscreen 1")); Tests::spawnKitty("kitty_C"); @@ -83,7 +92,7 @@ static bool test() { EXPECT_CONTAINS(str, "kitty_C"); } - OK(getFromSocket("/keyword misc:new_window_takes_over_fullscreen 2")); + OK(getFromSocket("/keyword misc:on_focus_under_fullscreen 2")); Tests::spawnKitty("kitty_D"); @@ -93,7 +102,7 @@ static bool test() { EXPECT_CONTAINS(str, "kitty_D"); } - OK(getFromSocket("/keyword misc:new_window_takes_over_fullscreen 0")); + OK(getFromSocket("/keyword misc:on_focus_under_fullscreen 0")); Tests::killAllWindows(); @@ -138,6 +147,7 @@ static bool test() { Tests::spawnKitty("kitty_A"); Tests::spawnKitty("kitty_B"); + OK(getFromSocket("/dispatch focuswindow class:kitty_A")); OK(getFromSocket("/dispatch fullscreen 0 set")); { -- cgit v1.2.3