From: Po Lu Date: Wed, 6 Apr 2022 02:29:53 +0000 (+0800) Subject: * src/emacs.c (main): Improve accuracy of daemon warning message on PGTK. X-Git-Tag: emacs-29.0.90~1931^2~750 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f0ff20be51980731364ef5ccf0505c35ea1b4e78;p=emacs.git * src/emacs.c (main): Improve accuracy of daemon warning message on PGTK. --- diff --git a/src/emacs.c b/src/emacs.c index 2a4dcc2c2c3..acb409fcb73 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1734,12 +1734,25 @@ main (int argc, char **argv) sockfd = SD_LISTEN_FDS_START; #endif /* HAVE_LIBSYSTEMD */ -#ifdef USE_GTK + /* On X, the bug happens because we call abort to avoid GLib + crashes upon a longjmp in our X error handler. + + On PGTK, GTK calls exit in its own error handlers for either + X or Wayland. Display different messages depending on the + window system to avoid referring users to the wrong GTK bug + report. */ +#ifdef HAVE_PGTK + fputs ("Due to a limitation in GTK 3, Emacs built with PGTK will simply exit when a" + "display connection is closed." + "\nThere is no way to fix this problem, so if you want to use Emacs on Wayland" + "on multiple displays and have Emacs survive disconnects, you lose.", + stderr); +#elif defined USE_GTK fputs ("\nWarning: due to a long standing Gtk+ bug\nhttps://gitlab.gnome.org/GNOME/gtk/issues/221\n\ Emacs might crash when run in daemon mode and the X11 connection is unexpectedly lost.\n\ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem.\n", stderr); -#endif /* USE_GTK */ +#endif if (daemon_type == 2) {