From ff9e059de6dd30c813270ff5a74053339cc94765 Mon Sep 17 00:00:00 2001 From: Maximilian Seidler <78690852+PaideiaDilemma@users.noreply.github.com> Date: Thu, 6 Feb 2025 11:21:04 +0000 Subject: window: move size reporting to animation begin callback (#9298) * window: fix resizes with an update callback * window: fixup sendWindowSize Remove the size argument from sendWindowSize, since it is now a member of the Window class and we don't want any mismatches between m_vRealSize and what we report. Remove sendWindowSize from mapWindow, since we shouldn't need it. * window: sendWindowSize on animation begin * window: move most calls to sendWindowSize to the animation begin callback * window: remove sendWindowSize in unmanaged if not fullscreen --- src/layout/IHyprLayout.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'src/layout/IHyprLayout.cpp') diff --git a/src/layout/IHyprLayout.cpp b/src/layout/IHyprLayout.cpp index 9a0ba6ee..e84ffb21 100644 --- a/src/layout/IHyprLayout.cpp +++ b/src/layout/IHyprLayout.cpp @@ -176,11 +176,9 @@ void IHyprLayout::onWindowCreatedFloating(PHLWINDOW pWindow) { pWindow->m_vRealSize->warp(); } - if (!pWindow->isX11OverrideRedirect()) { - pWindow->sendWindowSize(pWindow->m_vRealSize->goal()); - + if (!pWindow->isX11OverrideRedirect()) g_pCompositor->changeWindowZOrder(pWindow, true); - } else { + else { pWindow->m_vPendingReportedSize = pWindow->m_vRealSize->goal(); pWindow->m_vReportedSize = pWindow->m_vPendingReportedSize; } @@ -362,9 +360,6 @@ void IHyprLayout::onEndDragWindow() { DRAGGINGWINDOW->m_vLastFloatingSize = m_vDraggingWindowOriginalFloatSize; DRAGGINGWINDOW->m_bDraggingTiled = false; - if (pWindow->m_bIsFloating) - DRAGGINGWINDOW->sendWindowSize(DRAGGINGWINDOW->m_vRealSize->goal()); // match the size of the window - static auto USECURRPOS = CConfigValue("group:insert_after_current"); (*USECURRPOS ? pWindow : pWindow->getGroupTail())->insertWindowToGroup(DRAGGINGWINDOW); pWindow->setGroupCurrent(DRAGGINGWINDOW); @@ -606,10 +601,11 @@ void IHyprLayout::onMouseMove(const Vector2D& mousePos) { if (*PANIMATEMOUSE) *DRAGGINGWINDOW->m_vRealPosition = wb.pos(); - else + else { DRAGGINGWINDOW->m_vRealPosition->setValueAndWarp(wb.pos()); + DRAGGINGWINDOW->sendWindowSize(); + } - DRAGGINGWINDOW->sendWindowSize(DRAGGINGWINDOW->m_vRealSize->goal()); } else if (g_pInputManager->dragMode == MBIND_RESIZE || g_pInputManager->dragMode == MBIND_RESIZE_FORCE_RATIO || g_pInputManager->dragMode == MBIND_RESIZE_BLOCK_RATIO) { if (DRAGGINGWINDOW->m_bIsFloating) { @@ -679,9 +675,8 @@ void IHyprLayout::onMouseMove(const Vector2D& mousePos) { } else { DRAGGINGWINDOW->m_vRealSize->setValueAndWarp(wb.size()); DRAGGINGWINDOW->m_vRealPosition->setValueAndWarp(wb.pos()); + DRAGGINGWINDOW->sendWindowSize(); } - - DRAGGINGWINDOW->sendWindowSize(DRAGGINGWINDOW->m_vRealSize->goal()); } else { resizeActiveWindow(TICKDELTA, m_eGrabbedCorner, DRAGGINGWINDOW); } @@ -787,7 +782,6 @@ void IHyprLayout::changeWindowFloatingMode(PHLWINDOW pWindow) { g_pCompositor->updateWindowAnimatedDecorationValues(pWindow); pWindow->updateToplevel(); - pWindow->sendWindowSize(pWindow->m_vRealSize->goal()); g_pHyprRenderer->damageWindow(pWindow); } -- cgit v1.2.3