summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-07-14 11:47:00 +0800
committerPo Lu <luangruo@yahoo.com>2022-07-14 11:47:00 +0800
commitd37ba6f259b972aa44c66ecb76210e03a3084183 (patch)
tree717f766b91ba59ff1d26aedccc45d7d7f992cc55
parent9a888323c60c60fb37f471ef03f0bcdff91cb850 (diff)
downloademacs-d37ba6f259b972aa44c66ecb76210e03a3084183.tar.gz
Fix killing Emacs upon display disconnect
* src/xterm.c (x_connection_closed): On Xt builds terminals can be left alive without any frames on them, so take that into account. (bug#56528)
-rw-r--r--src/xterm.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 3dfbe111d3f..1d0e69d32bc 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -23531,7 +23531,11 @@ For details, see etc/PROBLEMS.\n",
unblock_input ();
- if (terminal_list == 0)
+ /* Sometimes another terminal is still alive, but deleting this
+ terminal caused all frames to vanish. In that case, simply kill
+ Emacs, since the next redisplay will abort as there is no more
+ selected frame. (bug#56528) */
+ if (terminal_list == 0 || NILP (selected_frame))
Fkill_emacs (make_fixnum (70), Qnil);
totally_unblock_input ();