loginManager: Create session proxy asynchronously

Most of the function is already asynchronous, except for the
initialization of the returned proxy. gjs' D-Bus wrapper gained
some convenience API a while ago that makes this trivial enough,
so use it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3636>
This commit is contained in:
Florian Müllner 2025-02-13 02:53:02 +01:00 committed by Marge Bot
parent a7cc1e626a
commit a719b7039e

View File

@ -143,8 +143,8 @@ class LoginManagerSystemd extends Signals.EventEmitter {
try {
const [objectPath] = await this._proxy.GetSessionAsync(sessionId);
this._currentSession = new SystemdLoginSession(Gio.DBus.system,
'org.freedesktop.login1', objectPath);
this._currentSession = await SystemdLoginSession.newAsync(
Gio.DBus.system, 'org.freedesktop.login1', objectPath);
return this._currentSession;
} catch (error) {
logError(error, 'Could not get a proxy for the current session');