From: Gerd Möllmann Date: Thu, 23 Jan 2025 19:53:50 +0000 (+0100) Subject: Handle update of invisible tty frames (bug#75056) X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3ce7666b17e2e9afffa42908284e5278562cb8ba;p=emacs.git Handle update of invisible tty frames (bug#75056) * src/dispnew.c (combine_updates_for_frame): Don't assume root frame is visible. (cherry picked from commit 15315780ae36cc2af6e276165562dc793334c2f9) --- diff --git a/src/dispnew.c b/src/dispnew.c index cf3f7e2acb8..fe82bcfd822 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -3961,11 +3961,20 @@ combine_updates_for_frame (struct frame *f, bool inhibit_scrolling) { #ifndef HAVE_ANDROID struct frame *root = root_frame (f); - eassert (FRAME_VISIBLE_P (root)); + + /* Determine visible frames on the root frame, including the root + frame itself. Note that there are cases, see bug#75056, where we + can be called for invisible frames. */ + Lisp_Object z_order = frames_in_reverse_z_order (root, true); + if (NILP (z_order)) + { + Lisp_Object root_frame; + XSETFRAME (root_frame, root); + z_order = Fcons (root_frame, Qnil); + } /* Process child frames in reverse z-order, topmost last. For each child, copy what we need to the root's desired matrix. */ - Lisp_Object z_order = frames_in_reverse_z_order (root, true); struct frame *topmost_child = NULL; for (Lisp_Object tail = XCDR (z_order); CONSP (tail); tail = XCDR (tail)) {