From 59ff7b2f891d06f4097128faf7027a3863542167 Mon Sep 17 00:00:00 2001 From: MithicSpirit Date: Sun, 19 Oct 2025 07:54:27 -0400 Subject: dispatchers: add forceidle (#11922) The forceidle dispatcher resets all ext-idle-notify timers as if the user had been idle for the specified number of seconds. If a notification has already fired, but would now be set with a nonzero delay, then it is reset. Conversely, if a timer has not yet fired, but would now be set to a nonpositive delay, then it is immediately fired. This process ignores any existing inhibitors, but timers are otherwise reset as normal if any new inhibitors are created or destroyed. --- src/protocols/IdleNotify.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/protocols/IdleNotify.hpp') diff --git a/src/protocols/IdleNotify.hpp b/src/protocols/IdleNotify.hpp index 02b59e65..0e0433a4 100644 --- a/src/protocols/IdleNotify.hpp +++ b/src/protocols/IdleNotify.hpp @@ -14,7 +14,6 @@ class CExtIdleNotification { bool good(); void onTimerFired(); - void onActivity(); bool inhibitorsAreObeyed() const; @@ -26,7 +25,11 @@ class CExtIdleNotification { bool m_idled = false; bool m_obeyInhibitors = false; - void updateTimer(); + void reset(); + void update(); + void update(uint32_t elapsedMs); + + friend class CIdleNotifyProtocol; }; class CIdleNotifyProtocol : public IWaylandProtocol { @@ -37,6 +40,7 @@ class CIdleNotifyProtocol : public IWaylandProtocol { void onActivity(); void setInhibit(bool inhibited); + void setTimers(uint32_t elapsedMs); private: void onManagerResourceDestroy(wl_resource* res); -- cgit v1.2.3