mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-25 13:45:58 +01:00
feat: remember maxiumize(fullscreenstate 1) pinned state too
This commit is contained in:
parent
d2a9c985c8
commit
22024dc0d6
2 changed files with 22 additions and 4 deletions
|
@ -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 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);
|
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_bPinned = false;
|
||||||
PWINDOW->m_bPinFullscreened = true;
|
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()));
|
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;
|
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
|
// TODO: update the state on syncFullscreen changes
|
||||||
if (!CHANGEINTERNAL && PWINDOW->m_sWindowData.syncFullscreen.valueOrDefault())
|
if (!CHANGEINTERNAL && PWINDOW->m_sWindowData.syncFullscreen.valueOrDefault())
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -335,6 +335,9 @@ class CWindow {
|
||||||
// For preserving pinned state when fullscreening a pinned window
|
// For preserving pinned state when fullscreening a pinned window
|
||||||
bool m_bPinFullscreened = false;
|
bool m_bPinFullscreened = false;
|
||||||
|
|
||||||
|
// For preserving pinned state when maximizing a pinned window
|
||||||
|
bool m_bPinMaximized = false;
|
||||||
|
|
||||||
// urgency hint
|
// urgency hint
|
||||||
bool m_bIsUrgent = false;
|
bool m_bIsUrgent = false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue