Control: severity -1 important Control: tags -1 + patch Hello,
I'm raising the severity of this bug report to important given that Debian Buster will most likely ship with GNOME desktop that is wayland based (and maybe other desktops as well?). I'm attaching a simple patch that work around the probems when running under wayland. (Other Gdk backends like broadway etc are still likely broken. The solution is likely to build putty with NOT_X_WINDOWS defined, to have putty avoid doing direct X11/Xlib calls. Not sure exactly which functionality that would affect though.) The attached patch should have no negative side effects, but it's not an optimal solution for neither wayland or other non-x11 gdk backends. The debian maintainer might want to consider building putty without X specific code (by defining NOT_X_WINDOWS). Regards, Andreas Henriksson
>From 505c54566b5281b43cdcfd19cd99999d24842441 Mon Sep 17 00:00:00 2001 From: Andreas Henriksson <[email protected]> Date: Thu, 14 Dec 2017 12:49:04 +0100 Subject: [PATCH] Use GDK_BACKEND x11 when built with X support When putty gets built with X Window System support it enables code that does direct X11 calls via Xlib. This will crash when not running under X11, eg. wayland, broadway, etc. To make it possible for a generic binary that's been built with X11 enabled to also work in wayland, tell GDK to use the x11 backend (unless the user has explicitly requested something else by setting GDK_BACKEND environment variable, but that will likely just make it crash again so maybe the 'override' argument to setenv should be 1 instead). This means putty should run under xwayland by default when built with X11 support and started in a wayland session like GNOME, etc. (For other backends like broadway, this will still likely not work as they don't have any equivalent to xwayland.) --- unix/gtkmain.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/unix/gtkmain.c b/unix/gtkmain.c index 67581604..aa26f35c 100644 --- a/unix/gtkmain.c +++ b/unix/gtkmain.c @@ -602,6 +602,15 @@ int main(int argc, char **argv) progname = argv[0]; +#ifndef NOT_X_WINDOWS + /* Putty does direct X11 specific calls, so in case we're running + * under eg. wayland make sure gtk+ still gives us the x11 backend + * or putty will segfault at startup. + * (eg. XGetDefault, Xlib calls in unix/gtkfont.c, etc.) + */ + setenv("GDK_BACKEND", "x11", 0); +#endif + /* * Copy the original argv before letting gtk_init fiddle with * it. It will be required later. -- 2.15.1

