mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-25 14:06:01 +01:00
binds: option to fullscreen pinned window
this stores the state in a var and apply pinned status back when un-fullscrening
This commit is contained in:
parent
67cee43006
commit
e51b201316
3 changed files with 13 additions and 0 deletions
|
@ -2339,6 +2339,7 @@ void CCompositor::setWindowFullscreenClient(const PHLWINDOW PWINDOW, const eFull
|
||||||
|
|
||||||
void CCompositor::setWindowFullscreenState(const PHLWINDOW PWINDOW, sFullscreenState state) {
|
void CCompositor::setWindowFullscreenState(const PHLWINDOW PWINDOW, sFullscreenState state) {
|
||||||
static auto PDIRECTSCANOUT = CConfigValue<Hyprlang::INT>("render:direct_scanout");
|
static auto PDIRECTSCANOUT = CConfigValue<Hyprlang::INT>("render:direct_scanout");
|
||||||
|
static auto PALLOWPINFULLSCREEN = CConfigValue<Hyprlang::INT>("binds:pin_fullscreen");
|
||||||
|
|
||||||
if (!validMapped(PWINDOW) || g_pCompositor->m_bUnsafeState)
|
if (!validMapped(PWINDOW) || g_pCompositor->m_bUnsafeState)
|
||||||
return;
|
return;
|
||||||
|
@ -2352,8 +2353,18 @@ 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 && !m_bPinFullscreened && PWINDOW->m_bPinned && !PWINDOW->isFullscreen()) {
|
||||||
|
PWINDOW->m_bPinned = false;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
// 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;
|
||||||
|
|
|
@ -94,6 +94,7 @@ class CCompositor {
|
||||||
bool m_bFinalRequests = false;
|
bool m_bFinalRequests = false;
|
||||||
bool m_bDesktopEnvSet = false;
|
bool m_bDesktopEnvSet = false;
|
||||||
bool m_bEnableXwayland = true;
|
bool m_bEnableXwayland = true;
|
||||||
|
bool m_bPinFullscreened = false;
|
||||||
|
|
||||||
// ------------------------------------------------- //
|
// ------------------------------------------------- //
|
||||||
|
|
||||||
|
|
|
@ -534,6 +534,7 @@ CConfigManager::CConfigManager() {
|
||||||
m_pConfig->addConfigValue("binds:movefocus_cycles_fullscreen", Hyprlang::INT{1});
|
m_pConfig->addConfigValue("binds:movefocus_cycles_fullscreen", Hyprlang::INT{1});
|
||||||
m_pConfig->addConfigValue("binds:disable_keybind_grabbing", Hyprlang::INT{0});
|
m_pConfig->addConfigValue("binds:disable_keybind_grabbing", Hyprlang::INT{0});
|
||||||
m_pConfig->addConfigValue("binds:window_direction_monitor_fallback", Hyprlang::INT{1});
|
m_pConfig->addConfigValue("binds:window_direction_monitor_fallback", Hyprlang::INT{1});
|
||||||
|
m_pConfig->addConfigValue("binds:pin_fullscreen", Hyprlang::INT{0});
|
||||||
|
|
||||||
m_pConfig->addConfigValue("gestures:workspace_swipe", Hyprlang::INT{0});
|
m_pConfig->addConfigValue("gestures:workspace_swipe", Hyprlang::INT{0});
|
||||||
m_pConfig->addConfigValue("gestures:workspace_swipe_fingers", Hyprlang::INT{3});
|
m_pConfig->addConfigValue("gestures:workspace_swipe_fingers", Hyprlang::INT{3});
|
||||||
|
|
Loading…
Reference in a new issue