mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-24 15:45:59 +01:00
layout: restore fullscreen on window close
currently windows will be changed in tile mode if a fullscreen window is closed
This commit is contained in:
parent
bff54d85d0
commit
ae6b9e59ff
1 changed files with 10 additions and 5 deletions
|
@ -690,7 +690,10 @@ void Events::listener_unmapWindow(void* owner, void* data) {
|
|||
PWINDOW->hyprListener_requestMinimize.removeCallback();
|
||||
}
|
||||
|
||||
if (PWINDOW->m_bIsFullscreen)
|
||||
const auto WORKSPACE = PWINDOW->m_iWorkspaceID;
|
||||
const bool FULLSCREEN = PWINDOW->m_bIsFullscreen;
|
||||
const auto FULLSCREENMODE = g_pCompositor->getWorkspaceByID(WORKSPACE)->m_efFullscreenMode;
|
||||
if (FULLSCREEN)
|
||||
g_pCompositor->setWindowFullscreen(PWINDOW, false, FULLSCREEN_FULL);
|
||||
|
||||
// Allow the renderer to catch the last frame.
|
||||
|
@ -713,11 +716,13 @@ void Events::listener_unmapWindow(void* owner, void* data) {
|
|||
g_pInputManager->releaseAllMouseButtons();
|
||||
}
|
||||
|
||||
// remove the fullscreen window status from workspace if we closed it
|
||||
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(PWINDOW->m_iWorkspaceID);
|
||||
// restore fullscreen if we closed a fullscreen window
|
||||
CWindow* FWINDOW = g_pCompositor->getFirstWindowOnWorkspace(WORKSPACE);
|
||||
|
||||
if (PWORKSPACE->m_bHasFullscreenWindow && PWINDOW->m_bIsFullscreen)
|
||||
PWORKSPACE->m_bHasFullscreenWindow = false;
|
||||
if (FWINDOW && FULLSCREEN) {
|
||||
Debug::log(LOG, "Set fullscreen in the first window of workspace {}", WORKSPACE);
|
||||
g_pCompositor->setWindowFullscreen(FWINDOW, true, FULLSCREENMODE);
|
||||
}
|
||||
|
||||
g_pLayoutManager->getCurrentLayout()->onWindowRemoved(PWINDOW);
|
||||
|
||||
|
|
Loading…
Reference in a new issue