]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix hiding tty cursor for overlapping children
authorGerd Möllmann <gerd@gnu.org>
Sun, 2 Feb 2025 04:39:47 +0000 (05:39 +0100)
committerEshel Yaron <me@eshelyaron.com>
Mon, 3 Feb 2025 11:15:10 +0000 (12:15 +0100)
* src/dispnew.c (is_cursor_obscured): If selected frame is in the
z-order of the root frame, use that, otherwise use the root frame.

(cherry picked from commit 42f1318e6579f94b90ef101f3f03ca65fb229262)

src/dispnew.c

index 627a9daf0bbd3bebd8504ae8f3962bad9fe62907..3328b197b07029d8b7e255a65ab67d277c9ba81c 100644 (file)
@@ -3906,10 +3906,12 @@ frame_selected_window_frame (struct frame *f)
 static bool
 is_cursor_obscured (struct frame *root)
 {
-  /* Determine in which frame on ROOT the cursor could be.  */
-  struct frame *sf = frame_selected_window_frame (root);
-  if (sf == NULL)
-    return false;
+  /* Which frame contains the cursor?  If the selected frame is in
+     root's z-order, it's the selected frame.  Otherwise fall back to
+     the root itself.  */
+  struct frame *sf = (frame_ancestor_p (root, SELECTED_FRAME ())
+                     ? SELECTED_FRAME ()
+                     : root);
 
   /* Give up if we can't tell where the cursor currently is.  */
   int x, y;