diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index 76b9aeb4..0e149736 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -776,6 +776,14 @@ void CHyprDwindleLayout::fullscreenRequestForWindow(CWindow* pWindow, eFullscree return; } + // save position and size if floating + if (pWindow->m_bIsFloating && on) { + pWindow->m_vLastFloatingSize = pWindow->m_vRealSize.goalv(); + pWindow->m_vLastFloatingPosition = pWindow->m_vRealPosition.goalv(); + pWindow->m_vPosition = pWindow->m_vRealPosition.goalv(); + pWindow->m_vSize = pWindow->m_vRealSize.goalv(); + } + // otherwise, accept it. pWindow->m_bIsFullscreen = on; PWORKSPACE->m_bHasFullscreenWindow = !PWORKSPACE->m_bHasFullscreenWindow; @@ -803,14 +811,6 @@ void CHyprDwindleLayout::fullscreenRequestForWindow(CWindow* pWindow, eFullscree PWORKSPACE->m_efFullscreenMode = fullscreenMode; - // save position and size if floating - if (pWindow->m_bIsFloating) { - pWindow->m_vLastFloatingSize = pWindow->m_vRealSize.goalv(); - pWindow->m_vLastFloatingPosition = pWindow->m_vRealPosition.goalv(); - pWindow->m_vPosition = pWindow->m_vRealPosition.goalv(); - pWindow->m_vSize = pWindow->m_vRealSize.goalv(); - } - // apply new pos and size being monitors' box if (fullscreenMode == FULLSCREEN_FULL) { pWindow->m_vRealPosition = PMONITOR->vecPosition; diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp index 9a76801c..c27e7e9e 100644 --- a/src/layout/MasterLayout.cpp +++ b/src/layout/MasterLayout.cpp @@ -879,6 +879,14 @@ void CHyprMasterLayout::fullscreenRequestForWindow(CWindow* pWindow, eFullscreen return; } + // save position and size if floating + if (pWindow->m_bIsFloating && on) { + pWindow->m_vLastFloatingSize = pWindow->m_vRealSize.goalv(); + pWindow->m_vLastFloatingPosition = pWindow->m_vRealPosition.goalv(); + pWindow->m_vPosition = pWindow->m_vRealPosition.goalv(); + pWindow->m_vSize = pWindow->m_vRealSize.goalv(); + } + // otherwise, accept it. pWindow->m_bIsFullscreen = on; PWORKSPACE->m_bHasFullscreenWindow = !PWORKSPACE->m_bHasFullscreenWindow; @@ -906,14 +914,6 @@ void CHyprMasterLayout::fullscreenRequestForWindow(CWindow* pWindow, eFullscreen PWORKSPACE->m_efFullscreenMode = fullscreenMode; - // save position and size if floating - if (pWindow->m_bIsFloating) { - pWindow->m_vLastFloatingSize = pWindow->m_vRealSize.goalv(); - pWindow->m_vLastFloatingPosition = pWindow->m_vRealPosition.goalv(); - pWindow->m_vPosition = pWindow->m_vRealPosition.goalv(); - pWindow->m_vSize = pWindow->m_vRealSize.goalv(); - } - // apply new pos and size being monitors' box if (fullscreenMode == FULLSCREEN_FULL) { pWindow->m_vRealPosition = PMONITOR->vecPosition;