From a719b7039e11f4c0468b6e2a328d7bba38289db4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 13 Feb 2025 02:53:02 +0100 Subject: [PATCH] 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: --- js/misc/loginManager.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/misc/loginManager.js b/js/misc/loginManager.js index 465148492..4bbe7c42c 100644 --- a/js/misc/loginManager.js +++ b/js/misc/loginManager.js @@ -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');