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/protocols/ForeignToplevelWlr.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/protocols/ForeignToplevelWlr.cpp') 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 #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(SPm_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(wl_array_add(&state, sizeof(uint32_t))); *p = ZWLR_FOREIGN_TOPLEVEL_HANDLE_V1_STATE_ACTIVATED; } @@ -216,7 +217,7 @@ CForeignToplevelWlrManager::CForeignToplevelWlrManager(SPm_lastWindow; + m_lastFocus = Desktop::focusState()->window(); } void CForeignToplevelWlrManager::onMap(PHLWINDOW pWindow) { -- cgit v1.2.3