mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-22 19:09:48 +01:00
* feat: saving fullscreen mode and state for restoring later * style: no p-prefix, capitalised constants
This commit is contained in:
parent
f442f435d3
commit
bd526822de
2 changed files with 10 additions and 1 deletions
|
@ -352,6 +352,7 @@ CConfigManager::CConfigManager() {
|
|||
m_pConfig->addConfigValue("misc:close_special_on_empty", Hyprlang::INT{1});
|
||||
m_pConfig->addConfigValue("misc:background_color", Hyprlang::INT{0xff111111});
|
||||
m_pConfig->addConfigValue("misc:new_window_takes_over_fullscreen", Hyprlang::INT{0});
|
||||
m_pConfig->addConfigValue("misc:exit_window_retains_fullscreen", Hyprlang::INT{0});
|
||||
m_pConfig->addConfigValue("misc:initial_workspace_tracking", Hyprlang::INT{1});
|
||||
m_pConfig->addConfigValue("misc:middle_click_paste", Hyprlang::INT{1});
|
||||
|
||||
|
|
|
@ -580,6 +580,11 @@ void Events::listener_unmapWindow(void* owner, void* data) {
|
|||
|
||||
Debug::log(LOG, "{:c} unmapped", PWINDOW);
|
||||
|
||||
static auto PEXITRETAINSFS = CConfigValue<Hyprlang::INT>("misc:exit_window_retains_fullscreen");
|
||||
|
||||
const auto CURRENTWINDOWFSSTATE = PWINDOW->m_bIsFullscreen;
|
||||
const auto CURRENTWINDOWFSMODE = PWINDOW->m_pWorkspace->m_efFullscreenMode;
|
||||
|
||||
if (!PWINDOW->m_pWLSurface->exists() || !PWINDOW->m_bIsMapped) {
|
||||
Debug::log(WARN, "{} unmapped without being mapped??", PWINDOW);
|
||||
PWINDOW->m_bFadingOut = false;
|
||||
|
@ -638,8 +643,11 @@ void Events::listener_unmapWindow(void* owner, void* data) {
|
|||
|
||||
Debug::log(LOG, "On closed window, new focused candidate is {}", PWINDOWCANDIDATE);
|
||||
|
||||
if (PWINDOWCANDIDATE != g_pCompositor->m_pLastWindow.lock() && PWINDOWCANDIDATE)
|
||||
if (PWINDOWCANDIDATE != g_pCompositor->m_pLastWindow.lock() && PWINDOWCANDIDATE) {
|
||||
g_pCompositor->focusWindow(PWINDOWCANDIDATE);
|
||||
if (*PEXITRETAINSFS && CURRENTWINDOWFSSTATE)
|
||||
g_pCompositor->setWindowFullscreen(PWINDOWCANDIDATE, true, CURRENTWINDOWFSMODE);
|
||||
}
|
||||
|
||||
if (!PWINDOWCANDIDATE && g_pCompositor->getWindowsOnWorkspace(PWINDOW->workspaceID()) == 0)
|
||||
g_pInputManager->refocus();
|
||||
|
|
Loading…
Reference in a new issue