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/render/Renderer.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/render/Renderer.cpp')
| -rw-r--r-- | src/render/Renderer.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index c8c44ad0..3b811ce8 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -14,6 +14,7 @@ #include "../managers/LayoutManager.hpp" #include "../desktop/Window.hpp" #include "../desktop/LayerSurface.hpp" +#include "../desktop/state/FocusState.hpp" #include "../protocols/SessionLock.hpp" #include "../protocols/LayerShell.hpp" #include "../protocols/XDGShell.hpp" @@ -168,7 +169,7 @@ CHyprRenderer::CHyprRenderer() { w->m_wlSurface->resource()->frame(Time::steadyNow()); auto FEEDBACK = makeUnique<CQueuedPresentationData>(w->m_wlSurface->resource()); - FEEDBACK->attachMonitor(g_pCompositor->m_lastMonitor.lock()); + FEEDBACK->attachMonitor(Desktop::focusState()->monitor()); FEEDBACK->discarded(); PROTO::presentation->queueData(std::move(FEEDBACK)); } @@ -403,7 +404,7 @@ void CHyprRenderer::renderWorkspaceWindows(PHLMONITOR pMonitor, PHLWORKSPACE pWo continue; // render active window after all others of this pass - if (w == g_pCompositor->m_lastWindow) { + if (w == Desktop::focusState()->window()) { lastWindow = w.lock(); continue; } @@ -1407,7 +1408,7 @@ void CHyprRenderer::renderMonitor(PHLMONITOR pMonitor, bool commit) { renderLockscreen(pMonitor, NOW, renderBox); - if (pMonitor == g_pCompositor->m_lastMonitor) { + if (pMonitor == Desktop::focusState()->monitor()) { g_pHyprNotificationOverlay->draw(pMonitor); g_pHyprError->draw(); } @@ -1895,7 +1896,7 @@ void CHyprRenderer::arrangeLayersForMonitor(const MONITORID& monitor) { CBox usableArea = {PMONITOR->m_position.x, PMONITOR->m_position.y, PMONITOR->m_size.x, PMONITOR->m_size.y}; - if (g_pHyprError->active() && g_pCompositor->m_lastMonitor == PMONITOR->m_self) { + if (g_pHyprError->active() && Desktop::focusState()->monitor() == PMONITOR->m_self) { const auto HEIGHT = g_pHyprError->height(); if (*BAR_POSITION == 0) { PMONITOR->m_reservedTopLeft.y = HEIGHT; |
