summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif/shell/quickshell-plugins
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/gkleen@sif/shell/quickshell-plugins')
-rw-r--r--accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp4
-rw-r--r--accounts/gkleen@sif/shell/quickshell-plugins/Systemd.hpp1
2 files changed, 4 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
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:
134 134
135 void update(); 135 void update();
136 136
137 bool mEnabled = true;
137 std::unique_ptr<ActiveSystemdInhibitor> activeInhibitor; 138 std::unique_ptr<ActiveSystemdInhibitor> activeInhibitor;
138 SystemdInhibitorParams::What mWhat = static_cast<SystemdInhibitorParams::What>(0); 139 SystemdInhibitorParams::What mWhat = static_cast<SystemdInhibitorParams::What>(0);
139 QString mWho; 140 QString mWho;