diff options
author | Iain Lane <iain@orangesquash.org.uk> | 2018-01-05 11:53:34 +0000 |
---|---|---|
committer | Benjamin Berg <benjamin@sipsolutions.net> | 2019-08-05 21:43:50 +0000 |
commit | fcba1e1a5d556ce7b52101dbd2d1ba4a19469161 (patch) | |
tree | 45b971f62cc9a1c50afb223ba54e2d5af6c585ac /daemon/gdm-manager.c | |
parent | f5305339390a4160434bdd19f80dcc4806d33329 (diff) | |
download | gdm-wip/benzea/systemd-user.tar.gz |
manager: Find user's current graphical session, not session of callerwip/benzea/systemd-user
If (e.g.) gnome-shell is started as a systemd --user unit, it won't be
part of the login session. We should instead look through all of the
user's sessions until we find the login session, and take that as our
session.
Diffstat (limited to 'daemon/gdm-manager.c')
-rw-r--r-- | daemon/gdm-manager.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c index 23e3b85d..c9150bfd 100644 --- a/daemon/gdm-manager.c +++ b/daemon/gdm-manager.c @@ -494,21 +494,22 @@ get_display_and_details_for_bus_sender (GdmManager *self, ret = gdm_dbus_get_uid_for_name (sender, &caller_uid, &error); if (!ret) { - g_debug ("GdmManager: Error while retrieving uid for sender: %s", + g_debug ("GdmManager: Error while retrieving uid for sender: %d", error->message); g_error_free (error); goto out; } - session_id = get_session_id_for_pid (pid, &error); + ret = gdm_find_display_session_for_uid (caller_uid, &session_id, &error); - if (session_id == NULL) { - g_debug ("GdmManager: Error while retrieving session id for sender: %s", + if (!ret) { + g_debug ("GdmManager: Unable to find display session for uid %s: %s", + caller_uid, error->message); g_error_free (error); goto out; } - + if (out_session_id != NULL) { *out_session_id = g_strdup (session_id); } |