Blame SOURCES/0003-common-Reload-settings-when-graphics-initialize.patch

4e44f9
From a9928bfcc9c6d81d60e047b7838d4107835b8f89 Mon Sep 17 00:00:00 2001
4e44f9
From: Ray Strode <rstrode@redhat.com>
4e44f9
Date: Tue, 15 Feb 2022 14:33:22 -0500
4e44f9
Subject: [PATCH 3/4] common: Reload settings when graphics initialize
4e44f9
4e44f9
If GDM starts faster than graphics initialize, then the
4e44f9
udev rules that write out /run/gdm/custom.conf might get
4e44f9
run too late for GDM to notice.
4e44f9
4e44f9
This commit changes GDM to reread its config after graphicals
4e44f9
initialization completes.
4e44f9
4e44f9
https://gitlab.gnome.org/GNOME/gdm/-/issues/763
4e44f9
---
4e44f9
 daemon/gdm-local-display-factory.c | 7 +++++--
4e44f9
 1 file changed, 5 insertions(+), 2 deletions(-)
4e44f9
4e44f9
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
4e44f9
index 0b1d3482..8bca8ce9 100644
4e44f9
--- a/daemon/gdm-local-display-factory.c
4e44f9
+++ b/daemon/gdm-local-display-factory.c
4e44f9
@@ -1023,64 +1023,66 @@ on_seat_properties_changed (GDBusConnection *connection,
4e44f9
         g_autoptr(GVariant) changed_prop = NULL;
4e44f9
         g_autofree const gchar **invalidated_props = NULL;
4e44f9
         gboolean changed = FALSE;
4e44f9
         int ret;
4e44f9
 
4e44f9
         /* Extract seat id, i.e. the last element of the object path. */
4e44f9
         seat = strrchr (object_path, '/');
4e44f9
         if (seat == NULL)
4e44f9
                 return;
4e44f9
         seat += 1;
4e44f9
 
4e44f9
         /* Valid seat IDs must start with seat, i.e. ignore "auto" */
4e44f9
         if (!g_str_has_prefix (seat, "seat"))
4e44f9
                 return;
4e44f9
 
4e44f9
         g_variant_get (parameters, "(s@a{sv}^a&s)", NULL, &changed_props, &invalidated_props);
4e44f9
 
4e44f9
         changed_prop = g_variant_lookup_value (changed_props, "CanGraphical", NULL);
4e44f9
         if (changed_prop)
4e44f9
                 changed = TRUE;
4e44f9
         if (!changed && g_strv_contains (invalidated_props, "CanGraphical"))
4e44f9
                 changed = TRUE;
4e44f9
 
4e44f9
         if (!changed)
4e44f9
                 return;
4e44f9
 
4e44f9
         ret = sd_seat_can_graphical (seat);
4e44f9
         if (ret < 0)
4e44f9
                 return;
4e44f9
 
4e44f9
-        if (ret != 0)
4e44f9
+        if (ret != 0) {
4e44f9
+                gdm_settings_direct_reload ();
4e44f9
                 ensure_display_for_seat (GDM_LOCAL_DISPLAY_FACTORY (user_data), seat);
4e44f9
-        else
4e44f9
+        } else {
4e44f9
                 delete_display (GDM_LOCAL_DISPLAY_FACTORY (user_data), seat);
4e44f9
+        }
4e44f9
 }
4e44f9
 
4e44f9
 static gboolean
4e44f9
 lookup_by_session_id (const char *id,
4e44f9
                       GdmDisplay *display,
4e44f9
                       gpointer    user_data)
4e44f9
 {
4e44f9
         const char *looking_for = user_data;
4e44f9
         const char *current;
4e44f9
 
4e44f9
         current = gdm_display_get_session_id (display);
4e44f9
         return g_strcmp0 (current, looking_for) == 0;
4e44f9
 }
4e44f9
 
4e44f9
 static gboolean
4e44f9
 lookup_by_tty (const char *id,
4e44f9
               GdmDisplay *display,
4e44f9
               gpointer    user_data)
4e44f9
 {
4e44f9
         const char *tty_to_find = user_data;
4e44f9
         g_autofree char *tty_to_check = NULL;
4e44f9
         const char *session_id;
4e44f9
         int ret;
4e44f9
 
4e44f9
         session_id = gdm_display_get_session_id (display);
4e44f9
 
4e44f9
         if (!session_id)
4e44f9
                 return FALSE;
4e44f9
 
4e44f9
         ret = sd_session_get_tty (session_id, &tty_to_check);
4e44f9
@@ -1260,60 +1262,61 @@ on_vt_changed (GIOChannel    *source,
4e44f9
         }
4e44f9
 
4e44f9
         g_debug ("GdmLocalDisplayFactory: creating new display on seat0 because of VT change");
4e44f9
 
4e44f9
         ensure_display_for_seat (factory, "seat0");
4e44f9
 
4e44f9
         return G_SOURCE_CONTINUE;
4e44f9
 }
4e44f9
 #endif
4e44f9
 
4e44f9
 #ifdef HAVE_UDEV
4e44f9
 static void
4e44f9
 on_uevent (GUdevClient *client,
4e44f9
            const char  *action,
4e44f9
            GUdevDevice *device,
4e44f9
            GdmLocalDisplayFactory *factory)
4e44f9
 {
4e44f9
         if (!g_udev_device_get_device_file (device))
4e44f9
                 return;
4e44f9
 
4e44f9
         if (g_strcmp0 (action, "add") != 0 &&
4e44f9
             g_strcmp0 (action, "change") != 0)
4e44f9
                 return;
4e44f9
 
4e44f9
         if (!udev_is_settled (factory))
4e44f9
                 return;
4e44f9
 
4e44f9
         g_signal_handler_disconnect (factory->gudev_client, factory->uevent_handler_id);
4e44f9
         factory->uevent_handler_id = 0;
4e44f9
 
4e44f9
+        gdm_settings_direct_reload ();
4e44f9
         ensure_display_for_seat (factory, "seat0");
4e44f9
 }
4e44f9
 #endif
4e44f9
 
4e44f9
 static void
4e44f9
 gdm_local_display_factory_start_monitor (GdmLocalDisplayFactory *factory)
4e44f9
 {
4e44f9
         g_autoptr (GIOChannel) io_channel = NULL;
4e44f9
         const char *subsystems[] = { "drm", NULL };
4e44f9
 
4e44f9
         factory->seat_new_id = g_dbus_connection_signal_subscribe (factory->connection,
4e44f9
                                                                          "org.freedesktop.login1",
4e44f9
                                                                          "org.freedesktop.login1.Manager",
4e44f9
                                                                          "SeatNew",
4e44f9
                                                                          "/org/freedesktop/login1",
4e44f9
                                                                          NULL,
4e44f9
                                                                          G_DBUS_SIGNAL_FLAGS_NONE,
4e44f9
                                                                          on_seat_new,
4e44f9
                                                                          g_object_ref (factory),
4e44f9
                                                                          g_object_unref);
4e44f9
         factory->seat_removed_id = g_dbus_connection_signal_subscribe (factory->connection,
4e44f9
                                                                              "org.freedesktop.login1",
4e44f9
                                                                              "org.freedesktop.login1.Manager",
4e44f9
                                                                              "SeatRemoved",
4e44f9
                                                                              "/org/freedesktop/login1",
4e44f9
                                                                              NULL,
4e44f9
                                                                              G_DBUS_SIGNAL_FLAGS_NONE,
4e44f9
                                                                              on_seat_removed,
4e44f9
                                                                              g_object_ref (factory),
4e44f9
                                                                              g_object_unref);
4e44f9
-- 
4e44f9
2.34.1
4e44f9