From: Gerd Möllmann Date: Sat, 25 Jan 2025 13:28:11 +0000 (+0100) Subject: Reapply "Fix tty-frame-at for nested tty child frames" X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=45b1cc61505582c91199f1c70debae313d9121b1;p=emacs.git Reapply "Fix tty-frame-at for nested tty child frames" This reverts commit 9ad28959d6895720865c0718bf60f4b7b0b144f3. (cherry picked from commit e839b83c828fe09546edcc46dcfc5e09dd39b9fe) --- 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; }