diff options
| author | Nikolai Nechaev <nikolay_nechaev@mail.ru> | 2025-11-26 07:44:26 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-25 22:44:26 +0000 |
| commit | 40d8fa84919c6d0e9fcb1536f4bc09710d4c031c (patch) | |
| tree | e45044c92e5d8f716f2aa15668c61fed5aaf5895 /src/managers/input/InputMethodRelay.cpp | |
| parent | 1c1746de61a90dbbae072f3fc618c45af33fdd59 (diff) | |
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.
Diffstat (limited to 'src/managers/input/InputMethodRelay.cpp')
| -rw-r--r-- | src/managers/input/InputMethodRelay.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
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<CInputMethodV2> 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(); } |
