diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 3f766686..2c658e16 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -2338,7 +2338,7 @@ void CCompositor::setWindowFullscreenClient(const PHLWINDOW PWINDOW, const eFull } void CCompositor::setWindowFullscreenState(const PHLWINDOW PWINDOW, sFullscreenState state) { - static auto PDIRECTSCANOUT = CConfigValue("render:direct_scanout"); + static auto PDIRECTSCANOUT = CConfigValue("render:direct_scanout"); static auto PALLOWPINFULLSCREEN = CConfigValue("binds:pin_fullscreen"); if (!validMapped(PWINDOW) || g_pCompositor->m_bUnsafeState) @@ -2353,16 +2353,16 @@ void CCompositor::setWindowFullscreenState(const PHLWINDOW PWINDOW, sFullscreenS const eFullscreenMode CURRENT_EFFECTIVE_MODE = (eFullscreenMode)std::bit_floor((uint8_t)PWINDOW->m_sFullscreenState.internal); const eFullscreenMode EFFECTIVE_MODE = (eFullscreenMode)std::bit_floor((uint8_t)state.internal); - if (*PALLOWPINFULLSCREEN && !m_bPinFullscreened && PWINDOW->m_bPinned && !PWINDOW->isFullscreen()) { - PWINDOW->m_bPinned = false; - m_bPinFullscreened = true; + if (*PALLOWPINFULLSCREEN && !PWINDOW->m_bPinFullscreened && PWINDOW->m_bPinned && !PWINDOW->isFullscreen()) { + PWINDOW->m_bPinned = false; + PWINDOW->m_bPinFullscreened = true; } - const bool CHANGEINTERNAL = !(PWINDOW->m_bPinned || CURRENT_EFFECTIVE_MODE == EFFECTIVE_MODE || (PWORKSPACE->m_bHasFullscreenWindow && !PWINDOW->isFullscreen())); + const bool CHANGEINTERNAL = !(PWINDOW->m_bPinned || CURRENT_EFFECTIVE_MODE == EFFECTIVE_MODE || (PWORKSPACE->m_bHasFullscreenWindow && !PWINDOW->isFullscreen())); - if (*PALLOWPINFULLSCREEN && m_bPinFullscreened && !PWINDOW->m_bPinned && PWINDOW->isFullscreen()) { - PWINDOW->m_bPinned = true; - m_bPinFullscreened = false; + if (*PALLOWPINFULLSCREEN && PWINDOW->m_bPinFullscreened && !PWINDOW->m_bPinned && PWINDOW->isFullscreen()) { + PWINDOW->m_bPinned = true; + PWINDOW->m_bPinFullscreened = false; } // TODO: update the state on syncFullscreen changes diff --git a/src/Compositor.hpp b/src/Compositor.hpp index 535a6007..208b6ecf 100644 --- a/src/Compositor.hpp +++ b/src/Compositor.hpp @@ -94,7 +94,6 @@ class CCompositor { bool m_bFinalRequests = false; bool m_bDesktopEnvSet = false; bool m_bEnableXwayland = true; - bool m_bPinFullscreened = false; // ------------------------------------------------- // diff --git a/src/desktop/Window.hpp b/src/desktop/Window.hpp index ac81e5ef..5dd59437 100644 --- a/src/desktop/Window.hpp +++ b/src/desktop/Window.hpp @@ -332,6 +332,9 @@ class CWindow { // For pinned (sticky) windows bool m_bPinned = false; + // For preserving pinned state when fullscreening a pinned window + bool m_bPinFullscreened = false; + // urgency hint bool m_bIsUrgent = false;