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
79aed6bChris Townsend
plugins/Unity/Session/dbusunitysessionservice.cpp+11
@@ -35,6 +35,17 @@ void DBusUnitySessionService::Logout()
35 Q_EMIT logoutReady();
35 Q_EMIT logoutReady();
36}
36}
37
37
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+
38void DBusUnitySessionService::RequestLogout()
49void DBusUnitySessionService::RequestLogout()
39{
50{
40 Q_EMIT logoutRequested(false);
51 Q_EMIT logoutRequested(false);
plugins/Unity/Session/dbusunitysessionservice.h+8
@@ -39,6 +39,7 @@ public:
39 Q_INVOKABLE void logout() { Logout(); }
39 Q_INVOKABLE void logout() { Logout(); }
40 Q_INVOKABLE void reboot() { Reboot(); }
40 Q_INVOKABLE void reboot() { Reboot(); }
41 Q_INVOKABLE void shutdown() { Shutdown(); }
41 Q_INVOKABLE void shutdown() { Shutdown(); }
42+ Q_INVOKABLE void endSession() { EndSession(); }
42
43
43Q_SIGNALS:
44Q_SIGNALS:
44 /**
45 /**
@@ -139,6 +140,13 @@ public Q_SLOTS:
139 */
140 */
140 Q_SCRIPTABLE void RequestShutdown();
141 Q_SCRIPTABLE void RequestShutdown();
141
142
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();
142};
150};
143
151
144#endif // DBUSUNITYSESSIONSERVICE_H
152#endif // DBUSUNITYSESSIONSERVICE_H
qml/Components/Dialogs.qml+1
@@ -211,6 +211,7 @@ Item {
211 onLogoutReady: {
211 onLogoutReady: {
212 root.closeAllApps();
212 root.closeAllApps();
213 Qt.quit();
213 Qt.quit();
214+ unitySessionService.endSession();
214 }
215 }
215 }
216 }
216
217