[gnome-shell/wip/gdm-register-session: 12/12] main, LoginManager: Call GDM's RegisterSession()
- From: Iain Lane <iainl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/gdm-register-session: 12/12] main, LoginManager: Call GDM's RegisterSession()
- Date: Thu, 6 Jun 2019 14:02:17 +0000 (UTC)
commit 23366ad7e5d64fa6e4dd8f24bb2d69163a659530
Author: Iain Lane <iainl gnome org>
Date: Thu May 2 10:49:12 2019 +0100
main, LoginManager: Call GDM's RegisterSession()
So that it can know if we started up properly and use that to (e.g.)
kill its greeter.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/570
js/misc/loginManager.js | 22 ++++++++++++++++++++++
js/ui/main.js | 2 ++
2 files changed, 24 insertions(+)
---
diff --git a/js/misc/loginManager.js b/js/misc/loginManager.js
index f615b4f99..4f4cc836f 100644
--- a/js/misc/loginManager.js
+++ b/js/misc/loginManager.js
@@ -48,6 +48,28 @@ function canLock() {
}
}
+
+function registerSessionWithGDM() {
+ log("Registering session with GDM");
+ Gio.DBus.system.call('org.gnome.DisplayManager',
+ '/org/gnome/DisplayManager/Manager',
+ 'org.gnome.DisplayManager.Manager',
+ 'RegisterSession',
+ GLib.Variant.new('(a{sv})', [{}]), null,
+ Gio.DBusCallFlags.NONE, -1, null,
+ (source, result) => {
+ try {
+ source.call_finish(result);
+ } catch (e) {
+ if (!e.matches(Gio.DBusError, Gio.DBusError.UNKNOWN_METHOD))
+ log(`Error registering session with GDM: ${e.message}`);
+ else
+ log("Not calling RegisterSession(): method not exported, GDM too old?");
+ }
+ }
+ );
+}
+
let _loginManager = null;
/**
diff --git a/js/ui/main.js b/js/ui/main.js
index c01be9882..d68178ec4 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -247,6 +247,8 @@ function _initializeUI() {
['MESSAGE_ID=' + GNOMESHELL_STARTED_MESSAGE_ID]);
}
+ LoginManager.registerSessionWithGDM();
+
let perfModuleName = GLib.getenv("SHELL_PERF_MODULE");
if (perfModuleName) {
let perfOutput = GLib.getenv("SHELL_PERF_OUTPUT");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]