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/SeatManager.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/SeatManager.cpp')
| -rw-r--r-- | src/managers/SeatManager.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/managers/SeatManager.cpp b/src/managers/SeatManager.cpp index 3b3d8b04..6d49c97e 100644 --- a/src/managers/SeatManager.cpp +++ b/src/managers/SeatManager.cpp @@ -6,6 +6,7 @@ #include "../protocols/PrimarySelection.hpp" #include "../protocols/core/Compositor.hpp" #include "../Compositor.hpp" +#include "../desktop/state/FocusState.hpp" #include "../devices/IKeyboard.hpp" #include "../desktop/LayerSurface.hpp" #include "../managers/input/InputManager.hpp" @@ -659,7 +660,7 @@ void CSeatManager::setGrab(SP<CSeatGrab> grab) { // If this was a popup grab, focus its parent window to maintain context if (validMapped(parentWindow)) { - g_pCompositor->focusWindow(parentWindow); + Desktop::focusState()->rawWindowFocus(parentWindow); Debug::log(LOG, "[seatmgr] Refocused popup parent window {} (follow_mouse={})", parentWindow->m_title, *PFOLLOWMOUSE); } else g_pInputManager->refocusLastWindow(PMONITOR); @@ -689,10 +690,10 @@ void CSeatManager::setGrab(SP<CSeatGrab> grab) { refocus = layer->m_interactivity == ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_NONE; if (refocus) { - auto candidate = g_pCompositor->m_lastWindow.lock(); + auto candidate = Desktop::focusState()->window(); if (candidate) - g_pCompositor->focusWindow(candidate); + Desktop::focusState()->rawWindowFocus(candidate); } if (oldGrab->m_onEnd) |
