mirror of
https://github.com/brl/mutter.git
synced 2024-11-29 03:20:46 -05:00
launcher: simplify getting session dbus proxy
Use path "/org/freedesktop/login1/session/self" instead of getting session id and building the path manually https://bugzilla.gnome.org/show_bug.cgi?id=753434
This commit is contained in:
parent
c13ddafdb8
commit
8e22bf5bc9
@ -56,22 +56,12 @@ struct _MetaLauncher
|
|||||||
static Login1Session *
|
static Login1Session *
|
||||||
get_session_proxy (GCancellable *cancellable)
|
get_session_proxy (GCancellable *cancellable)
|
||||||
{
|
{
|
||||||
char *proxy_path;
|
|
||||||
char *session_id;
|
|
||||||
Login1Session *session_proxy;
|
Login1Session *session_proxy;
|
||||||
|
|
||||||
if (sd_pid_get_session (getpid (), &session_id) < 0)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
proxy_path = get_escaped_dbus_path ("/org/freedesktop/login1/session", session_id);
|
|
||||||
|
|
||||||
session_proxy = login1_session_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
|
session_proxy = login1_session_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
|
||||||
G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
|
G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
|
||||||
"org.freedesktop.login1",
|
"org.freedesktop.login1",
|
||||||
proxy_path,
|
"/org/freedesktop/login1/session/self",
|
||||||
cancellable, NULL);
|
cancellable, NULL);
|
||||||
free (proxy_path);
|
|
||||||
|
|
||||||
return session_proxy;
|
return session_proxy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user