|
|
c90517 |
From d2cf186fd0f0b860c6dd282cf8630c3a0f4935a6 Mon Sep 17 00:00:00 2001
|
|
|
c90517 |
From: Ray Strode <rstrode@redhat.com>
|
|
|
c90517 |
Date: Thu, 9 Aug 2018 12:48:25 -0400
|
|
|
c90517 |
Subject: [PATCH 20/48] local-display-factory: add some more debug statements
|
|
|
c90517 |
|
|
|
c90517 |
This commit just sprinkles in a few more `g_debug`'s for
|
|
|
c90517 |
log file clarity.
|
|
|
c90517 |
---
|
|
|
c90517 |
daemon/gdm-local-display-factory.c | 5 +++++
|
|
|
c90517 |
1 file changed, 5 insertions(+)
|
|
|
c90517 |
|
|
|
c90517 |
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
|
|
|
c90517 |
index c58de9c17..6f3a4c391 100644
|
|
|
c90517 |
--- a/daemon/gdm-local-display-factory.c
|
|
|
c90517 |
+++ b/daemon/gdm-local-display-factory.c
|
|
|
c90517 |
@@ -364,76 +364,80 @@ on_display_status_changed (GdmDisplay *display,
|
|
|
c90517 |
|
|
|
c90517 |
static gboolean
|
|
|
c90517 |
lookup_by_seat_id (const char *id,
|
|
|
c90517 |
GdmDisplay *display,
|
|
|
c90517 |
gpointer user_data)
|
|
|
c90517 |
{
|
|
|
c90517 |
const char *looking_for = user_data;
|
|
|
c90517 |
char *current;
|
|
|
c90517 |
gboolean res;
|
|
|
c90517 |
|
|
|
c90517 |
g_object_get (G_OBJECT (display), "seat-id", ¤t, NULL);
|
|
|
c90517 |
|
|
|
c90517 |
res = g_strcmp0 (current, looking_for) == 0;
|
|
|
c90517 |
|
|
|
c90517 |
g_free(current);
|
|
|
c90517 |
|
|
|
c90517 |
return res;
|
|
|
c90517 |
}
|
|
|
c90517 |
|
|
|
c90517 |
static GdmDisplay *
|
|
|
c90517 |
create_display (GdmLocalDisplayFactory *factory,
|
|
|
c90517 |
const char *seat_id,
|
|
|
c90517 |
const char *session_type,
|
|
|
c90517 |
gboolean initial)
|
|
|
c90517 |
{
|
|
|
c90517 |
GdmDisplayStore *store;
|
|
|
c90517 |
GdmDisplay *display = NULL;
|
|
|
c90517 |
char *active_session_id = NULL;
|
|
|
c90517 |
int ret;
|
|
|
c90517 |
|
|
|
c90517 |
+ g_debug ("GdmLocalDisplayFactory: %s login display for seat %s requested",
|
|
|
c90517 |
+ session_type? : "X11", seat_id);
|
|
|
c90517 |
store = gdm_display_factory_get_display_store (GDM_DISPLAY_FACTORY (factory));
|
|
|
c90517 |
|
|
|
c90517 |
ret = sd_seat_get_active (seat_id, &active_session_id, NULL);
|
|
|
c90517 |
|
|
|
c90517 |
if (ret == 0) {
|
|
|
c90517 |
char *login_session_id = NULL;
|
|
|
c90517 |
|
|
|
c90517 |
/* If we already have a login window, switch to it */
|
|
|
c90517 |
if (gdm_get_login_window_session_id (seat_id, &login_session_id)) {
|
|
|
c90517 |
GdmDisplay *display;
|
|
|
c90517 |
|
|
|
c90517 |
display = gdm_display_store_find (store,
|
|
|
c90517 |
lookup_by_session_id,
|
|
|
c90517 |
(gpointer) login_session_id);
|
|
|
c90517 |
if (display != NULL && gdm_display_get_status (display) == GDM_DISPLAY_MANAGED) {
|
|
|
c90517 |
if (g_strcmp0 (active_session_id, login_session_id) != 0) {
|
|
|
c90517 |
+ g_debug ("GdmLocalDisplayFactory: session %s found, activating.",
|
|
|
c90517 |
+ login_session_id);
|
|
|
c90517 |
gdm_activate_session_by_id (factory->priv->connection, seat_id, login_session_id);
|
|
|
c90517 |
}
|
|
|
c90517 |
g_clear_pointer (&login_session_id, g_free);
|
|
|
c90517 |
g_clear_pointer (&active_session_id, g_free);
|
|
|
c90517 |
return NULL;
|
|
|
c90517 |
}
|
|
|
c90517 |
g_clear_pointer (&login_session_id, g_free);
|
|
|
c90517 |
}
|
|
|
c90517 |
g_clear_pointer (&active_session_id, g_free);
|
|
|
c90517 |
} else if (!sd_seat_can_multi_session (seat_id)) {
|
|
|
c90517 |
/* Ensure we don't create the same display more than once */
|
|
|
c90517 |
display = gdm_display_store_find (store, lookup_by_seat_id, (gpointer) seat_id);
|
|
|
c90517 |
|
|
|
c90517 |
if (display != NULL) {
|
|
|
c90517 |
return NULL;
|
|
|
c90517 |
}
|
|
|
c90517 |
}
|
|
|
c90517 |
|
|
|
c90517 |
g_debug ("GdmLocalDisplayFactory: Adding display on seat %s", seat_id);
|
|
|
c90517 |
|
|
|
c90517 |
#ifdef ENABLE_USER_DISPLAY_SERVER
|
|
|
c90517 |
if (g_strcmp0 (seat_id, "seat0") == 0) {
|
|
|
c90517 |
display = gdm_local_display_new ();
|
|
|
c90517 |
if (session_type != NULL) {
|
|
|
c90517 |
g_object_set (G_OBJECT (display), "session-type", session_type, NULL);
|
|
|
c90517 |
}
|
|
|
c90517 |
}
|
|
|
c90517 |
#endif
|
|
|
c90517 |
|
|
|
c90517 |
if (display == NULL) {
|
|
|
c90517 |
@@ -453,60 +457,61 @@ create_display (GdmLocalDisplayFactory *factory,
|
|
|
c90517 |
g_object_unref (display);
|
|
|
c90517 |
|
|
|
c90517 |
if (! gdm_display_manage (display)) {
|
|
|
c90517 |
gdm_display_unmanage (display);
|
|
|
c90517 |
}
|
|
|
c90517 |
|
|
|
c90517 |
return display;
|
|
|
c90517 |
}
|
|
|
c90517 |
|
|
|
c90517 |
static void
|
|
|
c90517 |
delete_display (GdmLocalDisplayFactory *factory,
|
|
|
c90517 |
const char *seat_id) {
|
|
|
c90517 |
|
|
|
c90517 |
GdmDisplayStore *store;
|
|
|
c90517 |
|
|
|
c90517 |
g_debug ("GdmLocalDisplayFactory: Removing used_display_numbers on seat %s", seat_id);
|
|
|
c90517 |
|
|
|
c90517 |
store = gdm_display_factory_get_display_store (GDM_DISPLAY_FACTORY (factory));
|
|
|
c90517 |
gdm_display_store_foreach_remove (store, lookup_by_seat_id, (gpointer) seat_id);
|
|
|
c90517 |
}
|
|
|
c90517 |
|
|
|
c90517 |
static gboolean
|
|
|
c90517 |
gdm_local_display_factory_sync_seats (GdmLocalDisplayFactory *factory)
|
|
|
c90517 |
{
|
|
|
c90517 |
GError *error = NULL;
|
|
|
c90517 |
GVariant *result;
|
|
|
c90517 |
GVariant *array;
|
|
|
c90517 |
GVariantIter iter;
|
|
|
c90517 |
const char *seat;
|
|
|
c90517 |
|
|
|
c90517 |
+ g_debug ("GdmLocalDisplayFactory: enumerating seats from logind");
|
|
|
c90517 |
result = g_dbus_connection_call_sync (factory->priv->connection,
|
|
|
c90517 |
"org.freedesktop.login1",
|
|
|
c90517 |
"/org/freedesktop/login1",
|
|
|
c90517 |
"org.freedesktop.login1.Manager",
|
|
|
c90517 |
"ListSeats",
|
|
|
c90517 |
NULL,
|
|
|
c90517 |
G_VARIANT_TYPE ("(a(so))"),
|
|
|
c90517 |
G_DBUS_CALL_FLAGS_NONE,
|
|
|
c90517 |
-1,
|
|
|
c90517 |
NULL, &error);
|
|
|
c90517 |
|
|
|
c90517 |
if (!result) {
|
|
|
c90517 |
g_warning ("GdmLocalDisplayFactory: Failed to issue method call: %s", error->message);
|
|
|
c90517 |
g_clear_error (&error);
|
|
|
c90517 |
return FALSE;
|
|
|
c90517 |
}
|
|
|
c90517 |
|
|
|
c90517 |
array = g_variant_get_child_value (result, 0);
|
|
|
c90517 |
g_variant_iter_init (&iter, array);
|
|
|
c90517 |
|
|
|
c90517 |
while (g_variant_iter_loop (&iter, "(&so)", &seat, NULL)) {
|
|
|
c90517 |
gboolean is_initial;
|
|
|
c90517 |
const char *session_type = NULL;
|
|
|
c90517 |
|
|
|
c90517 |
if (g_strcmp0 (seat, "seat0") == 0) {
|
|
|
c90517 |
is_initial = TRUE;
|
|
|
c90517 |
if (gdm_local_display_factory_use_wayland ())
|
|
|
c90517 |
session_type = "wayland";
|
|
|
c90517 |
} else {
|
|
|
c90517 |
is_initial = FALSE;
|
|
|
c90517 |
--
|
|
|
c90517 |
2.26.0
|
|
|
c90517 |
|