protocols: add version 2 of ext-idle-notify-v1 protocol (#8959)

Signed-off-by: James Ramsey <james.jehiel.ramsey@gmail.com>
Co-authored-by: James Ramsey <james.jehiel.ramsey@gmail.com>
This commit is contained in:
J. J. Ramsey 2025-02-11 09:58:43 -05:00 committed by GitHub
parent f2d43e5f21
commit f83fe9986b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 26 additions and 13 deletions

View file

@ -9,19 +9,22 @@ class CEventLoopTimer;
class CExtIdleNotification {
public:
CExtIdleNotification(SP<CExtIdleNotificationV1> resource_, uint32_t timeoutMs);
CExtIdleNotification(SP<CExtIdleNotificationV1> resource_, uint32_t timeoutMs, bool obeyInhibitors);
~CExtIdleNotification();
bool good();
void onTimerFired();
void onActivity();
bool inhibitorsAreObeyed() const;
private:
SP<CExtIdleNotificationV1> resource;
uint32_t timeoutMs = 0;
SP<CEventLoopTimer> timer;
bool idled = false;
bool idled = false;
bool obeyInhibitors = false;
void updateTimer();
};
@ -38,7 +41,7 @@ class CIdleNotifyProtocol : public IWaylandProtocol {
private:
void onManagerResourceDestroy(wl_resource* res);
void destroyNotification(CExtIdleNotification* notif);
void onGetNotification(CExtIdleNotifierV1* pMgr, uint32_t id, uint32_t timeout, wl_resource* seat);
void onGetNotification(CExtIdleNotifierV1* pMgr, uint32_t id, uint32_t timeout, wl_resource* seat, bool obeyInhibitors);
bool isInhibited = false;