]> git.eshelyaron.com Git - emacs.git/commitdiff
Handle update of invisible tty frames (bug#75056)
authorGerd Möllmann <gerd@gnu.org>
Thu, 23 Jan 2025 19:53:50 +0000 (20:53 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sat, 25 Jan 2025 17:43:40 +0000 (18:43 +0100)
* src/dispnew.c (combine_updates_for_frame): Don't assume root frame is
visible.

(cherry picked from commit 15315780ae36cc2af6e276165562dc793334c2f9)

src/dispnew.c

index cf3f7e2acb8c3c552337f1f0161da8c36caf84b9..fe82bcfd822425e8b4a0cd64aa59021e9c857f10 100644 (file)
@@ -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))
     {