From 7b31616a8e75f940d67e803ba8d91f0886d661cd Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Thu, 21 Nov 2024 01:48:51 +0800 Subject: [PATCH] fix: maxiumize(fullscreenstate 1) to fullscreen or vice versa won't make it be pinned remove: second var to remember maxiumize, use the same var --- src/Compositor.cpp | 15 ++------------- src/desktop/Window.hpp | 3 --- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 500b3d41..a11a5cf1 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -2354,29 +2354,18 @@ void CCompositor::setWindowFullscreenState(const PHLWINDOW PWINDOW, sFullscreenS const eFullscreenMode EFFECTIVE_MODE = (eFullscreenMode)std::bit_floor((uint8_t)state.internal); if (*PALLOWPINFULLSCREEN) { - if (!PWINDOW->m_bPinFullscreened && PWINDOW->m_sFullscreenState.internal != FSMODE_FULLSCREEN) { + if (!PWINDOW->m_bPinFullscreened && !PWINDOW->isFullscreen() && PWINDOW->m_bPinned) { PWINDOW->m_bPinned = false; PWINDOW->m_bPinFullscreened = true; - } else if (!PWINDOW->m_bPinMaximized && PWINDOW->m_sFullscreenState.internal != FSMODE_MAXIMIZED) { - PWINDOW->m_bPinned = false; - PWINDOW->m_bPinMaximized = true; } } const bool CHANGEINTERNAL = !(PWINDOW->m_bPinned || CURRENT_EFFECTIVE_MODE == EFFECTIVE_MODE || (PWORKSPACE->m_bHasFullscreenWindow && !PWINDOW->isFullscreen())); - if (*PALLOWPINFULLSCREEN && PWINDOW->m_bPinFullscreened && !PWINDOW->m_bPinned && PWINDOW->m_sFullscreenState.internal == FSMODE_FULLSCREEN) { - PWINDOW->m_bPinned = true; - PWINDOW->m_bPinFullscreened = false; - } - if (*PALLOWPINFULLSCREEN) { - if (PWINDOW->m_bPinFullscreened && PWINDOW->m_sFullscreenState.internal == FSMODE_FULLSCREEN) { + if (PWINDOW->m_bPinFullscreened && PWINDOW->isFullscreen() && !PWINDOW->m_bPinned && state.internal == FSMODE_NONE) { PWINDOW->m_bPinned = true; PWINDOW->m_bPinFullscreened = false; - } else if (PWINDOW->m_bPinMaximized && PWINDOW->m_sFullscreenState.internal == FSMODE_MAXIMIZED) { - PWINDOW->m_bPinned = true; - PWINDOW->m_bPinMaximized = false; } } diff --git a/src/desktop/Window.hpp b/src/desktop/Window.hpp index a00ff607..5dd59437 100644 --- a/src/desktop/Window.hpp +++ b/src/desktop/Window.hpp @@ -335,9 +335,6 @@ class CWindow { // For preserving pinned state when fullscreening a pinned window bool m_bPinFullscreened = false; - // For preserving pinned state when maximizing a pinned window - bool m_bPinMaximized = false; - // urgency hint bool m_bIsUrgent = false;