From 725b7aecc25125f020e5c2556103a18965c113dc Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 29 Aug 2022 21:46:41 +0200 Subject: [PATCH] packages/gdm: fix crash on monitor connect/disconnect event --- modules/autopatch/default.nix | 2 +- packages/patched-derivations.nix | 2 ++ .../base/gdm/fix-monitor-event-crash.patch | 34 +++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 patches/base/gdm/fix-monitor-event-crash.patch diff --git a/modules/autopatch/default.nix b/modules/autopatch/default.nix index 4b8f700..1460431 100644 --- a/modules/autopatch/default.nix +++ b/modules/autopatch/default.nix @@ -29,7 +29,7 @@ }; gnome = super.gnome.overrideScope' (self': super': { - inherit (patched) nautilus; + inherit (patched) nautilus gdm; gnome-control-center = patched.gnome-control-center.override { inherit (self') gnome-user-share; }; gnome-shell = super'.gnome-shell.overrideAttrs (old: { preFixup = old.preFixup + '' diff --git a/packages/patched-derivations.nix b/packages/patched-derivations.nix index ae0f8db..785f870 100644 --- a/packages/patched-derivations.nix +++ b/packages/patched-derivations.nix @@ -9,6 +9,8 @@ super: rec { ipfs = patch super.ipfs "patches/base/ipfs"; + gdm = patch' super.gnome.gdm; + gnome-control-center = patch' super.gnome.gnome-control-center; nautilus = (patch' super.gnome.nautilus).overrideAttrs (attrs: { diff --git a/patches/base/gdm/fix-monitor-event-crash.patch b/patches/base/gdm/fix-monitor-event-crash.patch new file mode 100644 index 0000000..5aef5c3 --- /dev/null +++ b/patches/base/gdm/fix-monitor-event-crash.patch @@ -0,0 +1,34 @@ +diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c +index 7de7b99cff5901458fb2155ede7c2aaf24a9fee6..b3335cd49915f2f8fecc666843e3c7262ab848f0 100644 +--- a/daemon/gdm-local-display-factory.c ++++ b/daemon/gdm-local-display-factory.c +@@ -78,7 +78,7 @@ struct _GdmLocalDisplayFactory + gboolean seat0_graphics_check_timed_out; + guint seat0_graphics_check_timeout_id; + +- guint uevent_handler_id; ++ gulong uevent_handler_id; + + #if defined(ENABLE_USER_DISPLAY_SERVER) + unsigned int active_vt; +@@ -710,6 +710,10 @@ udev_is_settled (GdmLocalDisplayFactory *factory) + + g_debug ("GdmLocalDisplayFactory: udev has %ssettled enough for graphics.", is_settled? "" : "not "); + g_list_free_full (devices, g_object_unref); ++ ++ if (is_settled) ++ g_clear_signal_handler (&factory->uevent_handler_id, factory->gudev_client); ++ + return is_settled; + } + #endif +@@ -1287,9 +1291,6 @@ on_uevent (GUdevClient *client, + if (!udev_is_settled (factory)) + return; + +- g_signal_handler_disconnect (factory->gudev_client, factory->uevent_handler_id); +- factory->uevent_handler_id = 0; +- + gdm_settings_direct_reload (); + ensure_display_for_seat (factory, "seat0"); + }