@@ -79,6 +79,17 @@ void SessionManager::getSessionSlot(QDBusPendingCallWatcher *watcher)
7979 this,
8080 SLOT(propertiesChanged(QString, QVariantMap, QStringList)));
8181
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",
87+ path.path(),
88+ "org.freedesktop.login1.Session",
89+ "Lock",
90+ this,
91+ SLOT(sessionLocked()));
92+
8293 propertiesChanged("", QVariantMap(), QStringList() << "Active");
8394 }
8495 watcher->deleteLater();
@@ -105,3 +116,9 @@ void SessionManager::propertiesChanged(const QString &interface, const QVariantM
105116 Q_EMIT activeChanged();
106117 }
107118}
119+
120+void SessionManager::sessionLocked()
121+{
122+ is_active = false;
123+ Q_EMIT activeChanged();
124+}