From dd422abb3359530bf999137ed1fe8bf97eefc2ed Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Tue, 5 Jul 2022 16:05:06 +0200 Subject: [PATCH] schedule frames at the end of avar loop --- src/managers/AnimationManager.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/managers/AnimationManager.cpp b/src/managers/AnimationManager.cpp index e48b4d1e..7574998d 100644 --- a/src/managers/AnimationManager.cpp +++ b/src/managers/AnimationManager.cpp @@ -53,15 +53,18 @@ void CAnimationManager::tick() { const auto PWINDOW = (CWindow*)av->m_pWindow; const auto PWORKSPACE = (CWorkspace*)av->m_pWorkspace; const auto PLAYER = (SLayerSurface*)av->m_pLayer; + SMonitor* PMONITOR = nullptr; wlr_box WLRBOXPREV = {0,0,0,0}; if (PWINDOW) { WLRBOXPREV = PWINDOW->getFullWindowBoundingBox(); + PMONITOR = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID); } else if (PWORKSPACE) { - const auto PMONITOR = g_pCompositor->getMonitorFromID(PWORKSPACE->m_iMonitorID); + PMONITOR = g_pCompositor->getMonitorFromID(PWORKSPACE->m_iMonitorID); WLRBOXPREV = {(int)PMONITOR->vecPosition.x, (int)PMONITOR->vecPosition.y, (int)PMONITOR->vecSize.x, (int)PMONITOR->vecSize.y}; } else if (PLAYER) { WLRBOXPREV = PLAYER->geometry; + PMONITOR = g_pCompositor->getMonitorFromVector(Vector2D(PLAYER->geometry.x, PLAYER->geometry.y) + Vector2D(PLAYER->geometry.width, PLAYER->geometry.height) / 2.f); } // beziers are with a switch unforto @@ -190,6 +193,9 @@ void CAnimationManager::tick() { // set size and pos if valid, but only if damage policy entire (dont if border for example) if (g_pCompositor->windowValidMapped(PWINDOW) && av->m_eDamagePolicy == AVARDAMAGE_ENTIRE) g_pXWaylandManager->setWindowSize(PWINDOW, PWINDOW->m_vRealSize.goalv()); + + // manually schedule a frame + wlr_output_schedule_frame(PMONITOR->output); } }