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. --- src/managers/input/InputMethodRelay.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/managers/input/InputMethodRelay.cpp') diff --git a/src/managers/input/InputMethodRelay.cpp b/src/managers/input/InputMethodRelay.cpp index c09d0624..0b434410 100644 --- a/src/managers/input/InputMethodRelay.cpp +++ b/src/managers/input/InputMethodRelay.cpp @@ -1,6 +1,5 @@ #include "InputMethodRelay.hpp" -#include "InputManager.hpp" -#include "../../Compositor.hpp" +#include "../../desktop/state/FocusState.hpp" #include "../../protocols/TextInputV3.hpp" #include "../../protocols/TextInputV1.hpp" #include "../../protocols/InputMethodV2.hpp" @@ -54,17 +53,17 @@ void CInputMethodRelay::onNewIME(SP pIME) { Debug::log(LOG, "New input popup"); }); - if (!g_pCompositor->m_lastFocus) + if (!Desktop::focusState()->surface()) return; for (auto const& ti : m_textInputs) { - if (ti->client() != g_pCompositor->m_lastFocus->client()) + if (ti->client() != Desktop::focusState()->surface()->client()) continue; if (ti->isV3()) - ti->enter(g_pCompositor->m_lastFocus.lock()); + ti->enter(Desktop::focusState()->surface()); else - ti->onEnabled(g_pCompositor->m_lastFocus.lock()); + ti->onEnabled(Desktop::focusState()->surface()); } } @@ -73,11 +72,11 @@ void CInputMethodRelay::removePopup(CInputPopup* pPopup) { } CTextInput* CInputMethodRelay::getFocusedTextInput() { - if (!g_pCompositor->m_lastFocus) + if (!Desktop::focusState()->surface()) return nullptr; for (auto const& ti : m_textInputs) { - if (ti->focusedSurface() == g_pCompositor->m_lastFocus) + if (ti->focusedSurface() == Desktop::focusState()->surface()) return ti.get(); } -- cgit v1.2.3