From 06a32d5531d54975eced2ee047b2829bcf4bf785 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gerd=20M=C3=B6llmann?= Date: Sun, 2 Feb 2025 05:39:47 +0100 Subject: [PATCH] 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) --- src/dispnew.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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; -- 2.39.5