animation: improve animations on multi refresh rate monitors (#12418)

This commit is contained in:
bea4dev 2025-11-24 00:48:15 +09:00 committed by GitHub
parent 56904edbd2
commit 2b0fd417d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 34 additions and 22 deletions

View file

@ -6,6 +6,7 @@
#include "../../defines.hpp"
#include "../../helpers/AnimatedVariable.hpp"
#include "../../desktop/DesktopTypes.hpp"
#include "../../helpers/time/Timer.hpp"
#include "../eventLoop/EventLoopTimer.hpp"
class CHyprAnimationManager : public Hyprutils::Animation::CAnimationManager {
@ -13,6 +14,7 @@ class CHyprAnimationManager : public Hyprutils::Animation::CAnimationManager {
CHyprAnimationManager();
void tick();
void frameTick();
virtual void scheduleTick();
virtual void onTicked();
@ -52,7 +54,9 @@ class CHyprAnimationManager : public Hyprutils::Animation::CAnimationManager {
float m_lastTickTimeMs;
private:
bool m_tickScheduled = false;
bool m_tickScheduled = false;
bool m_lastTickValid = false;
CTimer m_lastTickTimer;
};
inline UP<CHyprAnimationManager> g_pAnimationManager;