Hi, The attached patch fixes an issue reported on the mailing list [1]. After quitting a remote "emacsclient -c" frame using C-x 5 0, the SSH session will hang on exit. It is waiting for the X11 display connection to be closed, but Emacs never closes it. I have been using this patch for a few months without issue, with the Lucid toolkit, running "emacsclient -c" over a remote X11 connection. I just retested it on master (423c86cbde7b1ed1d42c7e21fef6e8be872857b0) with "./configure --with-x-toolkit=lucid" and it works for me. I would like others who use remote X11 emacsclient to try the patch, to make sure it does not introduce crashes, error messages or warnings. If it works for others, I can push the patch to master. Thomas 1. https://lists.gnu.org/archive/html/emacs-devel/2020-04/msg00950.html