From f9fb24577a0891bc4a8e9591c63ace789fd466a1 Mon Sep 17 00:00:00 2001 From: William Wernert Date: Wed, 21 Jan 2026 10:54:02 -0500 Subject: [PATCH] animation: reset tick state on session activation (#13024) After suspend/wake, the animation tick timer state (m_lastTickValid, m_tickScheduled) could be stale, causing framerate drops when blur is enabled. This was introduced in 2b0fd417 which changed the animation tick timing mechanism. Reset the tick state when the session becomes active to ensure a clean state for the animation system. --- src/Compositor.cpp | 4 ++++ src/managers/animation/AnimationManager.cpp | 5 +++++ src/managers/animation/AnimationManager.hpp | 3 +++ 3 files changed, 12 insertions(+) diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 3299113c..1d80c65c 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -483,6 +483,10 @@ void CCompositor::initAllSignals() { m_sessionActive = true; + // Reset animation tick state to avoid stale timer issues after suspend/wake + if (g_pAnimationManager) + g_pAnimationManager->resetTickState(); + for (auto const& m : m_monitors) { scheduleFrameForMonitor(m); m->applyMonitorRule(&m->m_activeMonitorRule, true); diff --git a/src/managers/animation/AnimationManager.cpp b/src/managers/animation/AnimationManager.cpp index bbd220b2..f6b43e23 100644 --- a/src/managers/animation/AnimationManager.cpp +++ b/src/managers/animation/AnimationManager.cpp @@ -286,6 +286,11 @@ void CHyprAnimationManager::onTicked() { m_tickScheduled = false; } +void CHyprAnimationManager::resetTickState() { + m_lastTickValid = false; + m_tickScheduled = false; +} + std::string CHyprAnimationManager::styleValidInConfigVar(const std::string& config, const std::string& style) { if (config.starts_with("window")) { if (style.starts_with("slide") || style == "gnome" || style == "gnomed") diff --git a/src/managers/animation/AnimationManager.hpp b/src/managers/animation/AnimationManager.hpp index b8acc53e..35bb1e8a 100644 --- a/src/managers/animation/AnimationManager.hpp +++ b/src/managers/animation/AnimationManager.hpp @@ -18,6 +18,9 @@ class CHyprAnimationManager : public Hyprutils::Animation::CAnimationManager { virtual void scheduleTick(); virtual void onTicked(); + // Reset tick state after session changes (suspend/wake, lock/unlock) + void resetTickState(); + using SAnimationPropertyConfig = Hyprutils::Animation::SAnimationPropertyConfig; template void createAnimation(const VarType& v, PHLANIMVAR& pav, SP pConfig, eAVarDamagePolicy policy) {