summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2016-08-25 14:04:02 -0400
committerRay Strode <rstrode@redhat.com>2016-08-25 14:04:02 -0400
commitf7c75de0bc77cef07a823278aec1417e9ada5422 (patch)
treed36f6eccb8a7a1c699e80887a428bbd3f7341d57
parent91598a99fa9a8b63ac9b0f907e835076c4b1de50 (diff)
downloadgdm-f7c75de0bc77cef07a823278aec1417e9ada5422.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.
-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;