I have been running emacs (x11 version, unwittingly) on wayland without realizing there is a wayland-specific version of emacs. My desktop has started spontaneously going apeshit and crashing. So my first move was to run emacs this way:
$ emacs --fg-daemon
$ emacsclient -c
The idea was that when the display manager goes to shit, I don’t lose my shit. I should be able to simply reattach to my emacs session by running emacsclient -c. Starting the emacs server yields this msg:
Warning: due to a long standing Gtk+ bug¹ https://gitlab.gnome.org/GNOME/gtk/issues/221 Emacs might crash when run in daemon mode and the X11 connection is unexpectedly lost. Using an Emacs configured with --with-x-toolkit=lucid does not have this problem.
Yikes. Note the keyword might crash. So there is an arbitrary chance of survival. So then I discovered there is a wayland-specific version of emacs (emacs-pgtk). Installing it on debian required removing the original X11 version of emacs and resolving some dependency issues by not installing some pkgs. Fine, I did that. Now when I run emacs-pgtk as a server, it starts with:
Due to a limitation in GTK 3, Emacs built with PGTK will simply exit when a display connection is closed. The problem is especially difficult to fix, such that Emacs on Wayland with multiple displays is unlikely ever to be able to survive disconnects.
Fuck. So now when wayland crashes or is shut down, there is no chance of recovery. WTF? I was perhaps better off running the X11 version on wayland, where there is at least a non-deterministic chance of recovery.
¹ Apparently gitlab.gnome.org is an exclusive access-restricted website, so I am blocked from even reading about the bug.


As I see it, emacs is the heart and soul of the whole gnu infra. Multi-million dollar projects have their engineers using it, particularly in aerospace. And gtk is not the only game in town. It is GTK that must serve the needs of emacs, not the other way around. So if GTK is failing to serve emacs well, why isn’t emacs ditching it? I suppose there is a diffusion of responsibility problem… none of the projects that depend on emacs, however big, wants to pony up the money that would benefit everyone.
@evenwicht @Zenie Emacs is not dependent on GTK though.
@evenwicht @Zenie I mean, you can avoid GTK if you want to.
Do you know off-hand what that entails? I ran this in Debian:
$ apt-cache depends emacs emacs |Depends: emacs-gtk |Depends: emacs-lucid Depends: emacs-nox $ apt-cache depends emacs-gtk | grep gtk emacs-gtk Depends: libgtk-3-0(edit) found the following, which implies that I need to compile emacs myself:
https://gist.github.com/abelardojarab/f4c154f1aa4e15fe6b97a8cfc2010022
The
--with-x-toolkit=lucidoption was also mentioned in the warning output of the daemon of the x11 version of emacs.It would be interesting to know if any platform already builds emacs that way. Would be nice if repology.org tracked that but I doubt it does.
@evenwicht emacs-lucid
ah, thanks!
@evenwicht
Found it! This recent.
https://koldfront.dk/solution/_of/_long/_standing/_emacs/_and/_gtk/_problem/_2000
@evenwicht it is so ancient at this point no one even wants to understand it.