From 12a19192d1b6e881eda573e48a13b791f8089e93 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gerd=20M=C3=B6llmann?= Date: Sat, 25 Jan 2025 06:43:49 +0100 Subject: [PATCH] Fix tty-frame-at for nested tty child frames * src/term.c (tty_frame_at): Translate child frame origin to absolute coordinates. (cherry picked from commit 9693f2a95ad14bf0caa34e60d72722d4dd4d85c9) --- src/term.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/term.c b/src/term.c index 00bc94e6e31..7397ee68347 100644 --- a/src/term.c +++ b/src/term.c @@ -2603,9 +2603,11 @@ tty_frame_at (int x, int y) { Lisp_Object frame = Fcar (frames); struct frame *f = XFRAME (frame); + int fx, fy; + root_xy (f, 0, 0, &fx, &fy); - if (f->left_pos <= x && x < f->left_pos + f->pixel_width && - f->top_pos <= y && y < f->top_pos + f->pixel_height) + if (fx <= x && x < fx + f->pixel_width + && fy <= y && y < fy + f->pixel_height) return frame; } -- 2.39.5