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

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