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/UnifiedWorkspaceSwipeGesture.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/UnifiedWorkspaceSwipeGesture.cpp')
| -rw-r--r-- | src/managers/input/UnifiedWorkspaceSwipeGesture.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/managers/input/UnifiedWorkspaceSwipeGesture.cpp b/src/managers/input/UnifiedWorkspaceSwipeGesture.cpp index 01b92b48..6dae1e63 100644 --- a/src/managers/input/UnifiedWorkspaceSwipeGesture.cpp +++ b/src/managers/input/UnifiedWorkspaceSwipeGesture.cpp @@ -1,6 +1,7 @@ #include "UnifiedWorkspaceSwipeGesture.hpp" #include "../../Compositor.hpp" +#include "../../desktop/state/FocusState.hpp" #include "../../render/Renderer.hpp" #include "InputManager.hpp" @@ -12,18 +13,18 @@ void CUnifiedWorkspaceSwipeGesture::begin() { if (isGestureInProgress()) return; - const auto PWORKSPACE = g_pCompositor->m_lastMonitor->m_activeWorkspace; + const auto PWORKSPACE = Desktop::focusState()->monitor()->m_activeWorkspace; Debug::log(LOG, "CUnifiedWorkspaceSwipeGesture::begin: Starting a swipe from {}", PWORKSPACE->m_name); m_workspaceBegin = PWORKSPACE; m_delta = 0; - m_monitor = g_pCompositor->m_lastMonitor; + m_monitor = Desktop::focusState()->monitor(); m_avgSpeed = 0; m_speedPoints = 0; if (PWORKSPACE->m_hasFullscreenWindow) { - for (auto const& ls : g_pCompositor->m_lastMonitor->m_layerSurfaceLayers[2]) { + for (auto const& ls : Desktop::focusState()->monitor()->m_layerSurfaceLayers[2]) { *ls->m_alpha = 1.f; } } @@ -307,7 +308,7 @@ void CUnifiedWorkspaceSwipeGesture::end() { g_pInputManager->refocus(); // apply alpha - for (auto const& ls : g_pCompositor->m_lastMonitor->m_layerSurfaceLayers[2]) { + for (auto const& ls : Desktop::focusState()->monitor()->m_layerSurfaceLayers[2]) { *ls->m_alpha = pSwitchedTo->m_hasFullscreenWindow && pSwitchedTo->m_fullscreenMode == FSMODE_FULLSCREEN ? 0.f : 1.f; } }
\ No newline at end of file |
