Skip to content

Commit

Permalink
main, LoginManager: Call GDM's RegisterSession()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
iainlane committed Jun 18, 2019
1 parent 76dc77f commit 0e37cd2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
22 changes: 22 additions & 0 deletions js/misc/loginManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down
2 changes: 2 additions & 0 deletions js/ui/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ function _initializeUI() {
});
}

LoginManager.registerSessionWithGDM();

let perfModuleName = GLib.getenv("SHELL_PERF_MODULE");
if (perfModuleName) {
let perfOutput = GLib.getenv("SHELL_PERF_OUTPUT");
Expand Down

0 comments on commit 0e37cd2

Please sign in to comment.