From: Po Lu Date: Sat, 2 Jul 2022 13:21:33 +0000 (+0800) Subject: Fix display disconnect when tooltip frame is alive X-Git-Tag: emacs-29.0.90~1447^2~1270 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=59d109b73c48ca41d240f1fbe10f7349e9df4e31;p=emacs.git Fix display disconnect when tooltip frame is alive * src/xterm.c (x_connection_closed): Don't dereference nil when loop finds a tooltip frame. --- diff --git a/src/xterm.c b/src/xterm.c index 2629997f2ac..0c695324f3b 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -23280,6 +23280,7 @@ x_connection_closed (Display *dpy, const char *error_message, bool ioerror) Emacs_XIOErrorHandler io_error_handler; xm_drop_start_message dmsg; struct frame *f; + Lisp_Object minibuf_frame, tmp; dpyinfo = x_display_info_for_display (dpy); error_msg = alloca (strlen (error_message) + 1); @@ -23379,9 +23380,14 @@ x_connection_closed (Display *dpy, const char *error_message, bool ioerror) that are on the dead display. */ FOR_EACH_FRAME (tail, frame) { - Lisp_Object minibuf_frame; + /* Tooltip frames don't have these, so avoid crashing. */ + + if (FRAME_TOOLTIP_P (XFRAME (frame))) + continue; + minibuf_frame = WINDOW_FRAME (XWINDOW (FRAME_MINIBUF_WINDOW (XFRAME (frame)))); + if (FRAME_X_P (XFRAME (frame)) && FRAME_X_P (XFRAME (minibuf_frame)) && ! EQ (frame, minibuf_frame) @@ -23432,11 +23438,8 @@ For details, see etc/PROBLEMS.\n", /* We have just closed all frames on this display. */ emacs_abort (); - { - Lisp_Object tmp; - XSETTERMINAL (tmp, dpyinfo->terminal); - Fdelete_terminal (tmp, Qnoelisp); - } + XSETTERMINAL (tmp, dpyinfo->terminal); + Fdelete_terminal (tmp, Qnoelisp); } unblock_input ();