From: Gerd Möllmann Date: Sun, 2 Feb 2025 04:39:47 +0000 (+0100) Subject: Fix hiding tty cursor for overlapping children X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=06a32d5531d54975eced2ee047b2829bcf4bf785;p=emacs.git Fix hiding tty cursor for overlapping children * 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) --- diff --git a/src/dispnew.c b/src/dispnew.c index 627a9daf0bb..3328b197b07 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -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;