spaceFM: Avoid segfault when running under Wayland

SpaceFM is a Gtk+ application that was written with only the X11 backend in
mind. By explicitly allowing only the "x11" backend, it will not try to use
the wayland backend when it is run under sway, for example.

Fixes #107242

+17 -1
+7 -1
pkgs/applications/misc/spacefm/default.nix
··· 13 sha256 = "089r6i40lxcwzp60553b18f130asspnzqldlpii53smz52kvpirx"; 14 }; 15 16 - patches = [ ./glibc-fix.patch ]; 17 18 configureFlags = [ 19 "--with-bash-path=${pkgs.bash}/bin/bash"
··· 13 sha256 = "089r6i40lxcwzp60553b18f130asspnzqldlpii53smz52kvpirx"; 14 }; 15 16 + patches = [ 17 + # fix compilation error due to missing include 18 + ./glibc-fix.patch 19 + 20 + # restrict GDK backends to only X11 21 + ./x11-only.patch 22 + ]; 23 24 configureFlags = [ 25 "--with-bash-path=${pkgs.bash}/bin/bash"
+10
pkgs/applications/misc/spacefm/x11-only.patch
···
··· 1 + --- a/src/main.c 2021-02-09 13:54:32.847364236 +0100 2 + +++ b/src/main.c 2021-02-09 10:41:51.541203271 +0100 3 + @@ -1350,6 +1351,7 @@ 4 + vfs_file_monitor_clean(); 5 + return 1; 6 + } 7 + + gdk_set_allowed_backends("x11"); 8 + gtk_init (&argc, &argv); 9 + int ret = custom_dialog_init( argc, argv ); 10 + if ( ret != 0 )