on xenial help sign in
Allow for proper logout session management. This uses the EndSession() Upstart DBus method on the current session bus. Fixes: #1360316

Approved by: Albert Astals Cid

commit79aed6bdeb030a37f82f7f2bc9a570b59039c955 authorChris Townsend <christopher.townsend@canonical.com> dateMon 2 Mar 2015, 12:09 (12 years ago) parent90194d1486441e
3 files changed+20
plugins/Unity/Session/dbusunitysessionservice.cpp+11 plugins/Unity/Session/dbusunitysessionservice.h+8 qml/Components/Dialogs.qml+1
plugins/Unity/Session/dbusunitysessionservice.cpp+11
@@ -35,6 +35,17 @@ void DBusUnitySessionService::Logout()
3535 Q_EMIT logoutReady();
3636}
3737
38+void DBusUnitySessionService::EndSession()
39+{
40+ QDBusConnection connection = QDBusConnection::sessionBus();
41+ QDBusInterface iface1 ("com.ubuntu.Upstart",
42+ "/com/ubuntu/Upstart",
43+ "com.ubuntu.Upstart0_6",
44+ connection);
45+
46+ iface1.call("EndSession");
47+}
48+
3849void DBusUnitySessionService::RequestLogout()
3950{
4051 Q_EMIT logoutRequested(false);
plugins/Unity/Session/dbusunitysessionservice.h+8
@@ -39,6 +39,7 @@ public:
3939 Q_INVOKABLE void logout() { Logout(); }
4040 Q_INVOKABLE void reboot() { Reboot(); }
4141 Q_INVOKABLE void shutdown() { Shutdown(); }
42+ Q_INVOKABLE void endSession() { EndSession(); }
4243
4344Q_SIGNALS:
4445 /**
@@ -139,6 +140,13 @@ public Q_SLOTS:
139140 */
140141 Q_SCRIPTABLE void RequestShutdown();
141142
143+ /**
144+ * Issue an EndSession request.
145+ *
146+ * This method calls the EndSession() Upstart DBus method on the
147+ * current DBus session bus.
148+ */
149+ Q_SCRIPTABLE void EndSession();
142150};
143151
144152#endif // DBUSUNITYSESSIONSERVICE_H
qml/Components/Dialogs.qml+1
@@ -211,6 +211,7 @@ Item {
211211 onLogoutReady: {
212212 root.closeAllApps();
213213 Qt.quit();
214+ unitySessionService.endSession();
214215 }
215216 }
216217