From 1320decc26ee7905c78f22a8b46d6401cd61476e Mon Sep 17 00:00:00 2001 From: Sergei Poljanski Date: Tue, 13 Oct 2026 06:31:49 +0400 Subject: [PATCH] desktop: patch mutter crash on grabs by cancelled touches meta_wayland_touch_cancel() clears focus_surface on active touches but keeps their serials until the finger lifts. A client asking for a move/resize grab with such a serial (anotherim-js's resize edges by touch) makes touch_can_grab_surface() dereference NULL and takes down gnome-shell (four crashes on 2026-10-13, same address). Carry a one-line NULL check until nixpkgs' mutter has a fix; it is not upstream as of mutter 50.2 / main. Assisted-by: Claude:opus-5 --- modules/desktop.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/desktop.nix b/modules/desktop.nix index f77b445..5291afc 100644 --- a/modules/desktop.nix +++ b/modules/desktop.nix @@ -15,6 +15,18 @@ services.displayManager.gdm.enable = true; services.desktopManager.gnome.enable = true; + # gnome-shell segfaults in touch_can_grab_surface() when a client asks for + # a move/resize grab with the serial of a cancelled touch (NULL + # focus_surface). Not fixed upstream as of mutter 50.2 / main 2026-10-13. + # Drop once nixpkgs' mutter carries a fix. + nixpkgs.overlays = [ + (final: prev: { + mutter = prev.mutter.overrideAttrs (old: { + patches = (old.patches or [ ]) ++ [ ../patches/mutter-touch-cancelled-grab.patch ]; + }); + }) + ]; + # Let systemd-logind own all sleep/idle policy. gsd-power otherwise # second-guesses suspend-then-hibernate and re-wakes the machine before # HibernateDelaySec elapses (observed on P14s G6 AMD). Set via dconf