summaryrefslogtreecommitdiff
path: root/daemon/gdm-manager.c
diff options
context:
space:
mode:
authorIain Lane <iain@orangesquash.org.uk>2018-01-05 11:53:34 +0000
committerBenjamin Berg <benjamin@sipsolutions.net>2019-08-05 21:43:50 +0000
commitfcba1e1a5d556ce7b52101dbd2d1ba4a19469161 (patch)
tree45b971f62cc9a1c50afb223ba54e2d5af6c585ac /daemon/gdm-manager.c
parentf5305339390a4160434bdd19f80dcc4806d33329 (diff)
downloadgdm-fcba1e1a5d556ce7b52101dbd2d1ba4a19469161.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.c11
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);
}