From 647747fbd6afef2f9f939682ab6527f3877ffbfb Mon Sep 17 00:00:00 2001 From: Alessandro Bono Date: Mon, 19 Aug 2024 18:02:04 +0200 Subject: [PATCH] loginDialog: Get username directly from the conflicting session The conflicting session is owned by the same user per definition. Use the Name property of the conflicting session to get the username instead of assuming that `this._user` is defined and passing the username around. Part-of: --- data/dbus-interfaces/org.freedesktop.login1.Session.xml | 1 + js/gdm/loginDialog.js | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/data/dbus-interfaces/org.freedesktop.login1.Session.xml b/data/dbus-interfaces/org.freedesktop.login1.Session.xml index 5ebf2edf8..68c7d1162 100644 --- a/data/dbus-interfaces/org.freedesktop.login1.Session.xml +++ b/data/dbus-interfaces/org.freedesktop.login1.Session.xml @@ -5,6 +5,7 @@ + diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js index db83f4621..9e1c050f8 100644 --- a/js/gdm/loginDialog.js +++ b/js/gdm/loginDialog.js @@ -414,9 +414,10 @@ export const ConflictingSessionDialog = GObject.registerClass({ 'force-stop': {}, }, }, class ConflictingSessionDialog extends ModalDialog.ModalDialog { - _init(conflictingSession, greeterSession, userName) { + _init(conflictingSession, greeterSession) { super._init(); + const userName = conflictingSession.Name; let bannerText; if (greeterSession.Remote && conflictingSession.Remote) /* Translators: is running for */ @@ -1091,8 +1092,7 @@ export const LoginDialog = GObject.registerClass({ _showConflictingSessionDialog(serviceName, conflictingSession) { let conflictingSessionDialog = new ConflictingSessionDialog(conflictingSession, - this._greeterSessionProxy, - this._user.get_user_name()); + this._greeterSessionProxy); conflictingSessionDialog.connect('cancel', () => { this._authPrompt.reset();