From b99c193e46292da45c273a1421d9ac8ed7b3588f Mon Sep 17 00:00:00 2001 From: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com> Date: Fri, 4 Jul 2025 22:16:25 +0000 Subject: [PATCH] internal: handle setGroupCurrent properly on fs groups (#10920) --- src/desktop/Window.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/desktop/Window.cpp b/src/desktop/Window.cpp index 6a6fec983..a7b0cdabb 100644 --- a/src/desktop/Window.cpp +++ b/src/desktop/Window.cpp @@ -1041,30 +1041,33 @@ void CWindow::setGroupCurrent(PHLWINDOW pWindow) { const auto CURRENTISFOCUS = PCURRENT == g_pCompositor->m_lastWindow.lock(); + const auto PWINDOWSIZE = PCURRENT->m_realSize->goal(); + const auto PWINDOWPOS = PCURRENT->m_realPosition->goal(); + const auto PWINDOWLASTFLOATINGSIZE = PCURRENT->m_lastFloatingSize; + const auto PWINDOWLASTFLOATINGPOSITION = PCURRENT->m_lastFloatingPosition; + if (FULLSCREEN) g_pCompositor->setWindowFullscreenInternal(PCURRENT, FSMODE_NONE); - const auto PWINDOWSIZE = PCURRENT->m_realSize->goal(); - const auto PWINDOWPOS = PCURRENT->m_realPosition->goal(); - PCURRENT->setHidden(true); pWindow->setHidden(false); // can remove m_pLastWindow g_pLayoutManager->getCurrentLayout()->replaceWindowDataWith(PCURRENT, pWindow); - if (PCURRENT->m_isFloating) { - pWindow->m_realPosition->setValueAndWarp(PWINDOWPOS); - pWindow->m_realSize->setValueAndWarp(PWINDOWSIZE); - } + pWindow->m_realPosition->setValueAndWarp(PWINDOWPOS); + pWindow->m_realSize->setValueAndWarp(PWINDOWSIZE); + + if (FULLSCREEN) + g_pCompositor->setWindowFullscreenInternal(pWindow, MODE); + + pWindow->m_lastFloatingSize = PWINDOWLASTFLOATINGSIZE; + pWindow->m_lastFloatingPosition = PWINDOWLASTFLOATINGPOSITION; g_pCompositor->updateAllWindowsAnimatedDecorationValues(); if (CURRENTISFOCUS) g_pCompositor->focusWindow(pWindow); - if (FULLSCREEN) - g_pCompositor->setWindowFullscreenInternal(pWindow, MODE); - g_pHyprRenderer->damageWindow(pWindow); pWindow->updateWindowDecos();