From 564853110a6e1367cc379bd8418d874829302d00 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 11 Sep 2025 23:17:57 +0200 Subject: ... --- accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp | 4 +++- accounts/gkleen@sif/shell/quickshell-plugins/Systemd.hpp | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'accounts/gkleen@sif/shell/quickshell-plugins') diff --git a/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp b/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp index 790f514f..884ea17f 100644 --- a/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp +++ b/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp @@ -118,6 +118,8 @@ std::string SystemdInhibitorParams::toString(SystemdInhibitorParams::Mode mode) bool SystemdInhibitor::enabled() const { return static_cast(this->activeInhibitor); } void SystemdInhibitor::setEnabled(bool enabled) { + this->mEnabled = enabled; + if (enabled) this->update(); else @@ -173,7 +175,7 @@ void SystemdInhibitor::release() { } void SystemdInhibitor::update() { - if (!this->mWhat || this->mWho.isEmpty() || this->mWhy.isEmpty() || !this->mMode) + if (!this->mWhat || this->mWho.isEmpty() || this->mWhy.isEmpty() || !this->mMode || !this->mEnabled) if (this->activeInhibitor) this->release(); else diff --git a/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.hpp b/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.hpp index cf978fea..84752d76 100644 --- a/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.hpp +++ b/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.hpp @@ -134,6 +134,7 @@ private: void update(); + bool mEnabled = true; std::unique_ptr activeInhibitor; SystemdInhibitorParams::What mWhat = static_cast(0); QString mWho; -- cgit v1.2.3