[gdm/wip/can-graphical-support] wip! very start of hooking up can-graphical
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdm/wip/can-graphical-support] wip! very start of hooking up can-graphical
- Date: Wed, 20 Sep 2017 20:52:11 +0000 (UTC)
commit c5b9268ed816e6080ec63bdac59cd0f56d87e548
Author: Ray Strode <rstrode redhat com>
Date: Wed Sep 20 16:46:53 2017 -0400
wip! very start of hooking up can-graphical
daemon/gdm-local-display-factory.c | 47 ++++++++++++++++++++++++++++++++----
1 files changed, 42 insertions(+), 5 deletions(-)
---
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
index 95bdc59..936c054 100644
--- a/daemon/gdm-local-display-factory.c
+++ b/daemon/gdm-local-display-factory.c
@@ -53,6 +53,7 @@ struct GdmLocalDisplayFactoryPrivate
GdmDBusLocalDisplayFactory *skeleton;
GDBusConnection *connection;
GHashTable *used_display_numbers;
+ GHashTable *seat_proxies;
/* FIXME: this needs to be per seat? */
guint num_failures;
@@ -459,7 +460,9 @@ gdm_local_display_factory_sync_seats (GdmLocalDisplayFactory *factory)
is_initial = FALSE;
}
- create_display (factory, seat, session_type, is_initial);
+ if (sd_seat_can_graphical (seat)) {
+ create_display (factory, seat, session_type, is_initial);
+ }
}
g_variant_unref (result);
@@ -468,6 +471,23 @@ gdm_local_display_factory_sync_seats (GdmLocalDisplayFactory *factory)
}
static void
+on_seat_can_graphical_changed (GDBusProxy *seat_proxy,
+ GParamSpec *param_spec,
+ gpointer user_data)
+{
+ GdmLocalDisplayFactory *factory = GDM_LOCAL_DISPLAY_FACTORY (user_data);
+ const char *seat;
+
+ seat = g_object_get_data (G_OBJECT (seat_proxy), "seat-id");
+
+ if (sd_seat_can_graphical (seat)) {
+ create_display (factory, seat, NULL, FALSE);
+ } else {
+ delete_display (factory, seat);
+ }
+}
+
+static void
on_seat_new (GDBusConnection *connection,
const gchar *sender_name,
const gchar *object_path,
@@ -476,10 +496,27 @@ on_seat_new (GDBusConnection *connection,
GVariant *parameters,
gpointer user_data)
{
- const char *seat;
+ GdmLocalDisplayFactory *factory = GDM_LOCAL_DISPLAY_FACTORY (user_data);
+ GError *error = NULL;
+ const char *seat, *seat_path;
+
+ g_variant_get (parameters, "(&s&o)", &seat, &seat_path);
+ GDBusProxy *seat_proxy = g_dbus_proxy_new_sync (factory->priv->connection,
+ "org.freedesktop.login1",
+ seat_path,
+ "org.freedesktop.login1.Seat",
+ NULL,
+ &error);
+ g_hash_table_insert (factory->priv->seat_proxies, g_strdup (seat), seat_proxy);
+ g_object_set_data_full (seat_proxy, "seat-id", g_strdup (seat), g_free);
+ g_signal_connect (seat_proxy,
+ "notify::can-graphical",
+ on_seat_can_graphical_changed,
+ factory);
- g_variant_get (parameters, "(&s&o)", &seat, NULL);
- create_display (GDM_LOCAL_DISPLAY_FACTORY (user_data), seat, NULL, FALSE);
+ if (sd_seat_can_graphical (seat)) {
+ create_display (GDM_LOCAL_DISPLAY_FACTORY (factory), seat, NULL, FALSE);
+ }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]