summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp')
-rw-r--r--accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp4
1 files changed, 3 insertions, 1 deletions
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)
118 118
119bool SystemdInhibitor::enabled() const { return static_cast<bool>(this->activeInhibitor); } 119bool SystemdInhibitor::enabled() const { return static_cast<bool>(this->activeInhibitor); }
120void SystemdInhibitor::setEnabled(bool enabled) { 120void SystemdInhibitor::setEnabled(bool enabled) {
121 this->mEnabled = enabled;
122
121 if (enabled) 123 if (enabled)
122 this->update(); 124 this->update();
123 else 125 else
@@ -173,7 +175,7 @@ void SystemdInhibitor::release() {
173} 175}
174 176
175void SystemdInhibitor::update() { 177void SystemdInhibitor::update() {
176 if (!this->mWhat || this->mWho.isEmpty() || this->mWhy.isEmpty() || !this->mMode) 178 if (!this->mWhat || this->mWho.isEmpty() || this->mWhy.isEmpty() || !this->mMode || !this->mEnabled)
177 if (this->activeInhibitor) 179 if (this->activeInhibitor)
178 this->release(); 180 this->release();
179 else 181 else