on xenial help sign in
also lock when logind is going to sleep
commit2427514eeb3934ea19835be94d9a64b06fc30c42 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateThu 12 May 2016, 19:07 (10 years ago) parent2ba4e6c
1 file changed+4
plugins/Unity/Session/dbusunitysessionservice.cpp+4
plugins/Unity/Session/dbusunitysessionservice.cpp+4
@@ -227,11 +227,14 @@ private Q_SLOTS:
227227 {
228228 if (!active) {
229229 setupSystemdInhibition();
230+ } else {
231+ Q_EMIT prepareForSleep();
230232 }
231233 }
232234
233235Q_SIGNALS:
234236 void screensaverActiveChanged(bool active);
237+ void prepareForSleep();
235238};
236239
237240Q_GLOBAL_STATIC(DBusUnitySessionServicePrivate, d)
@@ -245,6 +248,7 @@ DBusUnitySessionService::DBusUnitySessionService()
245248 // ... and our Unlocked() signal to the logind's session Unlock() signal
246249 // (lightdm handles the unlocking by calling logind's Unlock method which in turn emits this signal we connect to)
247250 QDBusConnection::systemBus().connect(LOGIN1_SERVICE, d->logindSessionPath, LOGIN1_SESSION_IFACE, QStringLiteral("Unlock"), this, SIGNAL(Unlocked()));
251+ connect(d, &DBusUnitySessionServicePrivate::prepareForSleep, this, &DBusUnitySessionService::PromptLock);
248252 } else {
249253 qWarning() << "Failed to connect to logind's session Lock/Unlock signals";
250254 }