summaryrefslogtreecommitdiff
path: root/daemon/gdm-wayland-session.c
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2016-08-25 14:04:02 -0400
committerRay Strode <rstrode@redhat.com>2016-08-31 15:53:39 -0400
commit15c84a4f7d966d3062e33326f1433280941145d0 (patch)
tree971984b88d8543f0c9523b93f8148d07b2e76e3f /daemon/gdm-wayland-session.c
parentaa7fbd983aa0a6e7b8208530e2e64a4faa55984d (diff)
downloadgdm-15c84a4f7d966d3062e33326f1433280941145d0.tar.gz
gdm-wayland-session: keep connection to session bus alive
This makes it behave more like gdm-x-session. Also, we're going to need the connection in a minute. https://bugzilla.gnome.org/show_bug.cgi?id=736660
Diffstat (limited to 'daemon/gdm-wayland-session.c')
-rw-r--r--daemon/gdm-wayland-session.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/daemon/gdm-wayland-session.c b/daemon/gdm-wayland-session.c
index 6f77741d..149eb8a1 100644
--- a/daemon/gdm-wayland-session.c
+++ b/daemon/gdm-wayland-session.c
@@ -42,8 +42,10 @@ typedef struct
{
GdmSettings *settings;
GCancellable *cancellable;
- GSubprocess *bus_subprocess;
- char *bus_address;
+
+ GSubprocess *bus_subprocess;
+ GDBusConnection *bus_connection;
+ char *bus_address;
GSubprocess *session_subprocess;
char *session_command;
@@ -112,7 +114,7 @@ spawn_bus (State *state,
if (bus_connection != NULL) {
g_debug ("session message bus already running, not starting another one");
- g_clear_object (&bus_connection);
+ state->bus_connection = bus_connection;
return TRUE;
}
@@ -177,6 +179,20 @@ spawn_bus (State *state,
on_bus_finished,
state);
+ bus_connection = g_dbus_connection_new_for_address_sync (state->bus_address,
+ G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT |
+ G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION,
+ NULL,
+ cancellable,
+ &error);
+
+ if (bus_connection == NULL) {
+ g_debug ("could not open connection to session bus: %s",
+ error->message);
+ goto out;
+ }
+
+ state->bus_connection = bus_connection;
is_running = TRUE;
out:
g_clear_object (&data_stream);
@@ -349,6 +365,7 @@ clear_state (State **out_state)
State *state = *out_state;
g_clear_object (&state->cancellable);
+ g_clear_object (&state->bus_connection);
g_clear_object (&state->session_subprocess);
g_clear_pointer (&state->main_loop, g_main_loop_unref);
*out_state = NULL;