From 08911712c355e3629308bc4082d063158efaeaf1 Mon Sep 17 00:00:00 2001 From: James Ramsey Date: Sat, 4 Jan 2025 16:26:55 -0500 Subject: [PATCH] Fix attempt to read private variable obeyInhibitors --- src/protocols/IdleNotify.cpp | 6 +++++- src/protocols/IdleNotify.hpp | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/protocols/IdleNotify.cpp b/src/protocols/IdleNotify.cpp index ae3de002..fed9bdab 100644 --- a/src/protocols/IdleNotify.cpp +++ b/src/protocols/IdleNotify.cpp @@ -55,6 +55,10 @@ void CExtIdleNotification::onActivity() { updateTimer(); } +bool CExtIdleNotification::inhibitorsAreObeyed() const { + return obeyInhibitors; +} + CIdleNotifyProtocol::CIdleNotifyProtocol(const wl_interface* iface, const int& ver, const std::string& name) : IWaylandProtocol(iface, ver, name) { ; } @@ -99,7 +103,7 @@ void CIdleNotifyProtocol::onActivity() { void CIdleNotifyProtocol::setInhibit(bool inhibited) { isInhibited = inhibited; for (auto const& n : m_vNotifications) { - if (n->obeyInhibitors) + if (n->inhibitorsAreObeyed()) n->onActivity(); } } \ No newline at end of file diff --git a/src/protocols/IdleNotify.hpp b/src/protocols/IdleNotify.hpp index 2fef7a16..8865d6bf 100644 --- a/src/protocols/IdleNotify.hpp +++ b/src/protocols/IdleNotify.hpp @@ -17,6 +17,8 @@ class CExtIdleNotification { void onTimerFired(); void onActivity(); + bool inhibitorsAreObeyed() const; + private: SP resource; uint32_t timeoutMs = 0;