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.
This commit is contained in:
William Wernert 2026-01-21 10:54:02 -05:00 committed by GitHub
parent 55f40ecc95
commit f9fb24577a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 0 deletions

View file

@ -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);

View file

@ -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")

View file

@ -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 <Animable VarType>
void createAnimation(const VarType& v, PHLANIMVAR<VarType>& pav, SP<SAnimationPropertyConfig> pConfig, eAVarDamagePolicy policy) {