feat: remember maxiumize(fullscreenstate 1) pinned state too

This commit is contained in:
littleblack111 2024-11-21 00:23:43 +08:00
parent d2a9c985c8
commit 22024dc0d6
No known key found for this signature in database
GPG key ID: 45AE0FF5962FA6EF
2 changed files with 22 additions and 4 deletions

View file

@ -2353,9 +2353,14 @@ 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 && !PWINDOW->m_bPinFullscreened && PWINDOW->m_bPinned && PWINDOW->m_sFullscreenState.internal != FSMODE_FULLSCREEN) {
if (*PALLOWPINFULLSCREEN) {
if (!PWINDOW->m_bPinFullscreened && PWINDOW->m_sFullscreenState.internal != FSMODE_FULLSCREEN) {
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()));
@ -2365,6 +2370,16 @@ void CCompositor::setWindowFullscreenState(const PHLWINDOW PWINDOW, sFullscreenS
PWINDOW->m_bPinFullscreened = false;
}
if (*PALLOWPINFULLSCREEN) {
if (PWINDOW->m_bPinFullscreened && PWINDOW->m_sFullscreenState.internal == FSMODE_FULLSCREEN) {
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;
}
}
// TODO: update the state on syncFullscreen changes
if (!CHANGEINTERNAL && PWINDOW->m_sWindowData.syncFullscreen.valueOrDefault())
return;

View file

@ -335,6 +335,9 @@ 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;