diff options
| author | MightyPlaza <123664421+MightyPlaza@users.noreply.github.com> | 2025-07-20 15:00:17 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-20 17:00:17 +0200 |
| commit | d4de69381e64e6b13002f719905707459dc6befb (patch) | |
| tree | ba332c96e310e59cf523b78b066b4d6e89fa5ad0 /src/desktop/Window.cpp | |
| parent | 503fc458d87728cb9cb3d7acb6f654a2a8b4dc31 (diff) | |
internal: set value and goal for window size and position on setGroupCurrent (#11120)
Diffstat (limited to 'src/desktop/Window.cpp')
| -rw-r--r-- | src/desktop/Window.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/desktop/Window.cpp b/src/desktop/Window.cpp index ceb21d09..14c9d4ce 100644 --- a/src/desktop/Window.cpp +++ b/src/desktop/Window.cpp @@ -1045,8 +1045,10 @@ 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 PWINDOWSIZE = PCURRENT->m_realSize->value(); + const auto PWINDOWPOS = PCURRENT->m_realPosition->value(); + const auto PWINDOWSIZEGOAL = PCURRENT->m_realSize->goal(); + const auto PWINDOWPOSGOAL = PCURRENT->m_realPosition->goal(); const auto PWINDOWLASTFLOATINGSIZE = PCURRENT->m_lastFloatingSize; const auto PWINDOWLASTFLOATINGPOSITION = PCURRENT->m_lastFloatingPosition; @@ -1058,8 +1060,14 @@ void CWindow::setGroupCurrent(PHLWINDOW pWindow) { g_pLayoutManager->getCurrentLayout()->replaceWindowDataWith(PCURRENT, pWindow); - pWindow->m_realPosition->setValueAndWarp(PWINDOWPOS); - pWindow->m_realSize->setValueAndWarp(PWINDOWSIZE); + if (PCURRENT->m_isFloating) { + pWindow->m_realPosition->setValueAndWarp(PWINDOWPOSGOAL); + pWindow->m_realSize->setValueAndWarp(PWINDOWSIZEGOAL); + pWindow->sendWindowSize(); + } + + pWindow->m_realPosition->setValue(PWINDOWPOS); + pWindow->m_realSize->setValue(PWINDOWSIZE); if (FULLSCREEN) g_pCompositor->setWindowFullscreenInternal(pWindow, MODE); @@ -1081,13 +1089,11 @@ void CWindow::insertWindowToGroup(PHLWINDOW pWindow) { const auto BEGINAT = m_self.lock(); const auto ENDAT = m_groupData.pNextWindow.lock(); - if (!pWindow->getDecorationByType(DECORATION_GROUPBAR)) - pWindow->addWindowDeco(makeUnique<CHyprGroupBarDecoration>(pWindow)); - if (!pWindow->m_groupData.pNextWindow.lock()) { BEGINAT->m_groupData.pNextWindow = pWindow; pWindow->m_groupData.pNextWindow = ENDAT; pWindow->m_groupData.head = false; + pWindow->addWindowDeco(makeUnique<CHyprGroupBarDecoration>(pWindow)); return; } |
