Skip to content

Commit

Permalink
meta-launcher: Explicitly look up object path for seat
Browse files Browse the repository at this point in the history
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 systemd/systemd#12424 (comment)

https://gitlab.gnome.org/GNOME/mutter/merge_requests/571
  • Loading branch information
Benjamin Berg committed May 10, 2019
1 parent 01d0316 commit 3c6484d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/backends/native/meta-launcher.c
Expand Up @@ -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: ");
Expand Down Expand Up @@ -493,6 +495,7 @@ meta_launcher_new (GError **error)
g_autoptr (Login1Session) session_proxy = NULL;
g_autoptr (Login1Seat) seat_proxy = NULL;
g_autofree char *seat_id = NULL;
g_autofree char *seat_proxy_path = NULL;
gboolean have_control = FALSE;

session_proxy = get_session_proxy (NULL, error);
Expand All @@ -511,7 +514,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;

Expand Down

0 comments on commit 3c6484d

Please sign in to comment.