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/TextInput.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/TextInput.cpp')
| -rw-r--r-- | src/managers/input/TextInput.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/managers/input/TextInput.cpp b/src/managers/input/TextInput.cpp index 5da5e47a..a2b37bb6 100644 --- a/src/managers/input/TextInput.cpp +++ b/src/managers/input/TextInput.cpp @@ -1,8 +1,7 @@ #include "TextInput.hpp" -#include "../../defines.hpp" #include "InputManager.hpp" #include "../../protocols/TextInputV1.hpp" -#include "../../Compositor.hpp" +#include "../../desktop/state/FocusState.hpp" #include "../../protocols/TextInputV3.hpp" #include "../../protocols/InputMethodV2.hpp" #include "../../protocols/core/Compositor.hpp" @@ -31,8 +30,8 @@ void CTextInput::initCallbacks() { g_pInputManager->m_relay.deactivateIME(this); }); - if (!g_pCompositor->m_lastFocus.expired() && g_pCompositor->m_lastFocus->client() == INPUT->client()) - enter(g_pCompositor->m_lastFocus.lock()); + if (Desktop::focusState()->surface() && Desktop::focusState()->surface()->client() == INPUT->client()) + enter(Desktop::focusState()->surface()); } else { const auto INPUT = m_v1Input.lock(); @@ -60,7 +59,7 @@ void CTextInput::onEnabled(SP<CWLSurfaceResource> surfV1) { // v1 only, map surface to PTI if (!isV3()) { - if (g_pCompositor->m_lastFocus != surfV1 || !m_v1Input->m_active) + if (Desktop::focusState()->surface() != surfV1 || !m_v1Input->m_active) return; enter(surfV1); |
