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/protocols/ForeignToplevelWlr.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/protocols/ForeignToplevelWlr.cpp')
| -rw-r--r-- | src/protocols/ForeignToplevelWlr.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/protocols/ForeignToplevelWlr.cpp b/src/protocols/ForeignToplevelWlr.cpp index 86b68584..ebe8163a 100644 --- a/src/protocols/ForeignToplevelWlr.cpp +++ b/src/protocols/ForeignToplevelWlr.cpp @@ -1,9 +1,10 @@ #include "ForeignToplevelWlr.hpp" +#include "core/Output.hpp" #include <algorithm> #include "../Compositor.hpp" -#include "managers/input/InputManager.hpp" -#include "protocols/core/Output.hpp" -#include "render/Renderer.hpp" +#include "../managers/input/InputManager.hpp" +#include "../desktop/state/FocusState.hpp" +#include "../render/Renderer.hpp" #include "../managers/HookSystemManager.hpp" #include "../managers/EventManager.hpp" @@ -50,7 +51,7 @@ CForeignToplevelHandleWlr::CForeignToplevelHandleWlr(SP<CZwlrForeignToplevelHand if (PWINDOW->m_workspace != monitor->m_activeWorkspace) { g_pCompositor->moveWindowToWorkspaceSafe(PWINDOW, monitor->m_activeWorkspace); - g_pCompositor->setActiveMonitor(monitor); + Desktop::focusState()->rawMonitorFocus(monitor); } } } @@ -178,7 +179,7 @@ void CForeignToplevelHandleWlr::sendState() { wl_array state; wl_array_init(&state); - if (PWINDOW == g_pCompositor->m_lastWindow) { + if (PWINDOW == Desktop::focusState()->window()) { auto p = sc<uint32_t*>(wl_array_add(&state, sizeof(uint32_t))); *p = ZWLR_FOREIGN_TOPLEVEL_HANDLE_V1_STATE_ACTIVATED; } @@ -216,7 +217,7 @@ CForeignToplevelWlrManager::CForeignToplevelWlrManager(SP<CZwlrForeignToplevelMa onMap(w); } - m_lastFocus = g_pCompositor->m_lastWindow; + m_lastFocus = Desktop::focusState()->window(); } void CForeignToplevelWlrManager::onMap(PHLWINDOW pWindow) { |
