I encountered a situation where Emacs was unexpectedly unresponsive and could reduce it to the following minimal reproducible example. This is on Emacs 30.2 on Linux in KDE and happens with X11 as well as Wayland:
Make sure your initialization file contains only these two lines:
(setopt server-stop-automatically 'delete-frame) (setopt use-dialog-box nil) Kill all running Emacs processes (just in case) and start emacsclient with some irrelevant file like so:
emacsclient /tmp/foo.txt --alternate-editor= --create-frame Type some characters, don't save the buffer, then click on the close box (the cross in the upper right corner of the window). Now Emacs doesn't respond anymore and has to be killed from the command line.
Apart from the proverbial "So don't do that" advice - is this expected behavior that is documented somewhere or is it a bug?
emacsclient: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.. That's exactly the situation you are describing I believe. Is you Emacs built withGtk+?M-x report-emacs-bug) with as much detail as you can muster on all the cases you have tested.