[gdm] user-switching: fix seat id confusion
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdm] user-switching: fix seat id confusion
- Date: Mon, 19 Mar 2012 16:39:12 +0000 (UTC)
commit c42a0b4f17b81b8f78494d15872e54df589cd5ec
Author: Ray Strode <rstrode redhat com>
Date: Mon Mar 19 12:33:25 2012 -0400
user-switching: fix seat id confusion
There's a few places in the code that was hardcoding consolekit
paths still.
This commit does some small changes to make that more systemd
compatible.
https://bugzilla.gnome.org/show_bug.cgi?id=655380
daemon/gdm-local-display-factory.c | 26 ++++++++++++++++++++++----
utils/gdmflexiserver.c | 4 ++--
2 files changed, 24 insertions(+), 6 deletions(-)
---
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
index 988b2ff..cb69a88 100644
--- a/daemon/gdm-local-display-factory.c
+++ b/daemon/gdm-local-display-factory.c
@@ -46,6 +46,7 @@
#define GDM_LOCAL_DISPLAY_FACTORY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDM_TYPE_LOCAL_DISPLAY_FACTORY, GdmLocalDisplayFactoryPrivate))
#define CK_SEAT1_PATH "/org/freedesktop/ConsoleKit/Seat1"
+#define SYSTEMD_SEAT0_PATH "seat0"
#define GDM_DBUS_PATH "/org/gnome/DisplayManager"
#define GDM_LOCAL_DISPLAY_FACTORY_DBUS_PATH GDM_DBUS_PATH "/LocalDisplayFactory"
@@ -186,6 +187,21 @@ store_display (GdmLocalDisplayFactory *factory,
g_hash_table_insert (factory->priv->displays, GUINT_TO_POINTER (num), NULL);
}
+static const char *
+get_seat_of_transient_display (GdmLocalDisplayFactory *factory)
+{
+ const char *seat_id;
+
+ /* FIXME: don't hardcode seat */
+#ifdef WITH_SYSTEMD
+ seat_id = SYSTEMD_SEAT0_PATH;
+#else
+ seat_id = CK_SEAT1_PATH;
+#endif
+
+ return seat_id;
+}
+
/*
Example:
dbus-send --system --dest=org.gnome.DisplayManager \
@@ -201,6 +217,7 @@ gdm_local_display_factory_create_transient_display (GdmLocalDisplayFactory *fact
gboolean ret;
GdmDisplay *display;
guint32 num;
+ const char *seat_id;
g_return_val_if_fail (GDM_IS_LOCAL_DISPLAY_FACTORY (factory), FALSE);
@@ -212,8 +229,8 @@ gdm_local_display_factory_create_transient_display (GdmLocalDisplayFactory *fact
display = gdm_transient_display_new (num);
- /* FIXME: don't hardcode seat1? */
- g_object_set (display, "seat-id", CK_SEAT1_PATH, NULL);
+ seat_id = get_seat_of_transient_display (factory);
+ g_object_set (display, "seat-id", seat_id, NULL);
store_display (factory, num, display);
@@ -245,6 +262,7 @@ gdm_local_display_factory_create_product_display (GdmLocalDisplayFactory *factor
gboolean ret;
GdmDisplay *display;
guint32 num;
+ const char *seat_id;
g_return_val_if_fail (GDM_IS_LOCAL_DISPLAY_FACTORY (factory), FALSE);
@@ -259,8 +277,8 @@ gdm_local_display_factory_create_product_display (GdmLocalDisplayFactory *factor
display = gdm_product_display_new (num, relay_address);
- /* FIXME: don't hardcode seat1? */
- g_object_set (display, "seat-id", CK_SEAT1_PATH, NULL);
+ seat_id = get_seat_of_transient_display (factory);
+ g_object_set (display, "seat-id", seat_id, NULL);
store_display (factory, num, display);
diff --git a/utils/gdmflexiserver.c b/utils/gdmflexiserver.c
index 423a837..4e07413 100644
--- a/utils/gdmflexiserver.c
+++ b/utils/gdmflexiserver.c
@@ -688,7 +688,7 @@ goto_login_session_for_ck (DBusConnection *connection,
}
}
- if (! ret) {
+ if (! ret && g_strcmp0 (seat_id, "/org/freedesktop/ConsoleKit/Seat1") == 0) {
res = create_transient_display (connection, error);
if (res) {
ret = TRUE;
@@ -878,7 +878,7 @@ goto_login_session_for_systemd (DBusConnection *connection,
}
}
- if (! ret) {
+ if (! ret && g_strcmp0 (seat_id, "seat0") == 0) {
res = create_transient_display (connection, error);
if (res) {
ret = TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]