Blame SOURCES/0020-local-display-factory-add-some-more-debug-statements.patch

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