Fix tty-frame-at for nested tty child frames

* src/term.c (tty_frame_at): Translate child frame origin to absolute
coordinates.
This commit is contained in:
Gerd Möllmann 2025-01-25 06:43:49 +01:00
parent 8cbb3c7335
commit 9693f2a95a

View file

@ -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;
}