[mutter/wip/benzea/systemd-user: 30/30] launcher: Explicitly look up object path for seat



commit 52945f383d5310b1a1e33179003dfe9e84559364
Author: Benjamin Berg <bberg redhat com>
Date:   Fri May 10 19:29:47 2019 +0200

    launcher: Explicitly look up object path for seat
    
    If mutter is running as a systemd user service, then we cannot use the
    magic "self" session for the ID lookup. For now we need to lookup the ID
    explicitly. Eventually we can change to use the magic "auto" paths for
    both the session and seat, but that will require systemd v243.
    
    See also https://github.com/systemd/systemd/pull/12424#issuecomment-487962314
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/571

 src/backends/native/meta-launcher.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/backends/native/meta-launcher.c b/src/backends/native/meta-launcher.c
index 93a1ca2f1..cc59ad537 100644
--- a/src/backends/native/meta-launcher.c
+++ b/src/backends/native/meta-launcher.c
@@ -251,13 +251,15 @@ get_session_proxy (GCancellable *cancellable,
 }
 
 static Login1Seat *
-get_seat_proxy (GCancellable *cancellable,
+get_seat_proxy (gchar        *seat_id,
+                GCancellable *cancellable,
                 GError      **error)
 {
+  g_autofree char *seat_proxy_path = get_escaped_dbus_path ("/org/freedesktop/login1/seat", seat_id);
   Login1Seat *seat = login1_seat_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
                                                          G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
                                                          "org.freedesktop.login1",
-                                                         "/org/freedesktop/login1/seat/self",
+                                                         seat_proxy_path,
                                                          cancellable, error);
   if (!seat)
     g_prefix_error(error, "Could not get seat proxy: ");
@@ -511,7 +513,7 @@ meta_launcher_new (GError **error)
   if (!seat_id)
     goto fail;
 
-  seat_proxy = get_seat_proxy (NULL, error);
+  seat_proxy = get_seat_proxy (seat_id, NULL, error);
   if (!seat_proxy)
     goto fail;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]