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/plugin/src/main.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'hyprtester/plugin/src/main.cpp') diff --git a/hyprtester/plugin/src/main.cpp b/hyprtester/plugin/src/main.cpp index 72120eac..cbc06723 100644 --- a/hyprtester/plugin/src/main.cpp +++ b/hyprtester/plugin/src/main.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #undef private #include @@ -45,7 +46,7 @@ static SDispatchResult test(std::string in) { // Trigger a snap move event for the active window static SDispatchResult snapMove(std::string in) { - const auto PLASTWINDOW = g_pCompositor->m_lastWindow.lock(); + const auto PLASTWINDOW = Desktop::focusState()->window(); if (!PLASTWINDOW->m_isFloating) return {.success = false, .error = "Window must be floating"}; @@ -259,13 +260,15 @@ static SDispatchResult addRule(std::string in) { } static SDispatchResult checkRule(std::string in) { - if (!g_pCompositor->m_lastWindow) + const auto PLASTWINDOW = Desktop::focusState()->window(); + + if (!PLASTWINDOW) return {.success = false, .error = "No window"}; - if (!g_pCompositor->m_lastWindow->m_ruleApplicator->m_otherProps.props.contains(ruleIDX)) + if (!PLASTWINDOW->m_ruleApplicator->m_otherProps.props.contains(ruleIDX)) return {.success = false, .error = "No rule"}; - if (g_pCompositor->m_lastWindow->m_ruleApplicator->m_otherProps.props[ruleIDX]->effect != "effect") + if (PLASTWINDOW->m_ruleApplicator->m_otherProps.props[ruleIDX]->effect != "effect") return {.success = false, .error = "Effect isn't \"effect\""}; return {}; -- cgit v1.2.3