From 8b383530122b972ca69cdac33427facf7b8aaadf Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sat, 19 Jul 2025 16:47:14 +0200 Subject: eventloop: improve timer handling to avoid crashes ref #11062 --- src/managers/eventLoop/EventLoopManager.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/managers/eventLoop/EventLoopManager.hpp') diff --git a/src/managers/eventLoop/EventLoopManager.hpp b/src/managers/eventLoop/EventLoopManager.hpp index 0835b242..d3a67ae5 100644 --- a/src/managers/eventLoop/EventLoopManager.hpp +++ b/src/managers/eventLoop/EventLoopManager.hpp @@ -27,8 +27,8 @@ class CEventLoopManager { void onTimerFire(); - // recalculates timers - void nudgeTimers(); + // schedules a recalc of the timers + void scheduleRecalc(); // schedules a function to run later, aka in a wayland idle event. void doLater(const std::function& fn); @@ -69,6 +69,7 @@ class CEventLoopManager { private: // Manages the event sources after AQ pollFDs change. void syncPollFDs(); + void nudgeTimers(); struct SEventSourceData { SP pollFD; @@ -84,6 +85,7 @@ class CEventLoopManager { struct { std::vector> timers; Hyprutils::OS::CFileDescriptor timerfd; + bool recalcScheduled = false; } m_timers; SIdleData m_idle; -- cgit v1.2.3