mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Merge pull request #910 from Typz/xfce-lock
Detect session lock on Xfce/XUbuntu 16.04
This commit is contained in:
commit
03eda06a38
@ -20,6 +20,7 @@
|
||||
#include <QDBusConnection>
|
||||
#include <QDBusInterface>
|
||||
#include <QDBusReply>
|
||||
#include <QProcessEnvironment>
|
||||
|
||||
ScreenLockListenerDBus::ScreenLockListenerDBus(QWidget *parent):
|
||||
ScreenLockListenerPrivate(parent)
|
||||
@ -34,7 +35,7 @@ ScreenLockListenerDBus::ScreenLockListenerDBus(QWidget *parent):
|
||||
"ActiveChanged", // signal name
|
||||
this, //receiver
|
||||
SLOT(freedesktopScreenSaver(bool)));
|
||||
|
||||
|
||||
sessionBus.connect(
|
||||
"org.gnome.SessionManager", // service
|
||||
"/org/gnome/SessionManager/Presence", // path
|
||||
@ -51,6 +52,15 @@ ScreenLockListenerDBus::ScreenLockListenerDBus(QWidget *parent):
|
||||
this, //receiver
|
||||
SLOT(logindPrepareForSleep(bool)));
|
||||
|
||||
QString sessionId = QProcessEnvironment::systemEnvironment().value("XDG_SESSION_ID");
|
||||
systemBus.connect(
|
||||
"", // service
|
||||
QString("/org/freedesktop/login1/session/") + sessionId, // path
|
||||
"org.freedesktop.login1.Session", // interface
|
||||
"Lock", // signal name
|
||||
this, //receiver
|
||||
SLOT(unityLocked()));
|
||||
|
||||
sessionBus.connect(
|
||||
"com.canonical.Unity", // service
|
||||
"/com/canonical/Unity/Session", // path
|
||||
@ -84,4 +94,4 @@ void ScreenLockListenerDBus::freedesktopScreenSaver(bool status)
|
||||
if (status) {
|
||||
emit screenLocked();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user