diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-27 15:13:49 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-27 15:13:49 +1000 |
| commit | d4dde2c02de48a0a8d89662519f0bf22bdd570e1 (patch) | |
| tree | a3253cedaf8692ecf3009c5d368242112d74830d /plugin/src/Caelestia/Internal/sleepnotifier.cpp | |
| parent | services/hypr: lock keys ignore mods (diff) | |
| download | caelestia-shell-d4dde2c02de48a0a8d89662519f0bf22bdd570e1.tar.gz caelestia-shell-d4dde2c02de48a0a8d89662519f0bf22bdd570e1.tar.bz2 caelestia-shell-d4dde2c02de48a0a8d89662519f0bf22bdd570e1.zip | |
idlemonitor: handle logind lock/unlock
Fixes #705
Diffstat (limited to '')
| -rw-r--r-- | plugin/src/Caelestia/Internal/sleepnotifier.cpp | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/plugin/src/Caelestia/Internal/sleepnotifier.cpp b/plugin/src/Caelestia/Internal/sleepnotifier.cpp deleted file mode 100644 index b730f38..0000000 --- a/plugin/src/Caelestia/Internal/sleepnotifier.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include "sleepnotifier.hpp" - -#include <QtDBus/qdbusconnection.h> -#include <QtDBus/qdbuserror.h> - -namespace caelestia::internal { - -SleepNotifier::SleepNotifier(QObject* parent) - : QObject(parent) { - auto bus = QDBusConnection::systemBus(); - if (!bus.isConnected()) { - qWarning() << "SleepNotifier::SleepNotifier: failed to connect to system bus:" << bus.lastError().message(); - return; - } - - const bool ok = bus.connect("org.freedesktop.login1", "/org/freedesktop/login1", "org.freedesktop.login1.Manager", - "PrepareForSleep", this, SLOT(handlePrepareForSleep(bool))); - - if (!ok) { - qWarning() << "SleepNotifier::SleepNotifier: failed to connect to dbus:" << bus.lastError().message(); - } -} - -void SleepNotifier::handlePrepareForSleep(bool sleep) { - if (sleep) { - emit aboutToSleep(); - } else { - emit resumed(); - } -} - -} // namespace caelestia::internal |