@@ -79,6 +79,17 @@ void SessionManager::getSessionSlot(QDBusPendingCallWatcher *watcher)
80 SLOT(propertiesChanged(QString, QVariantMap, QStringList)));
80 SLOT(propertiesChanged(QString, QVariantMap, QStringList)));
82+ // Login1 is very odd about emitting PropertiesChanged. It often does
83+ // not do so when active is becoming false. But it always does when
84+ // it becomes true. So we watch for the "Lock" signal too, which is a
85+ // reliably hint that active is false.
86+ l1_manager->connection().connect("org.freedesktop.login1",
88+ "org.freedesktop.login1.Session",
91+ SLOT(sessionLocked()));
82 propertiesChanged("", QVariantMap(), QStringList() << "Active");
93 propertiesChanged("", QVariantMap(), QStringList() << "Active");
84 watcher->deleteLater();
95 watcher->deleteLater();
@@ -105,3 +116,9 @@ void SessionManager::propertiesChanged(const QString &interface, const QVariantM
105 Q_EMIT activeChanged();
116 Q_EMIT activeChanged();
120+void SessionManager::sessionLocked()
123+ Q_EMIT activeChanged();