From: Gerd Möllmann Date: Sat, 25 Jan 2025 04:44:03 +0000 (+0100) Subject: Fix cursor positioning of nested tty child frames X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=32c9ff8209c6914e55d665feb9c5e059af2bd136;p=emacs.git Fix cursor positioning of nested tty child frames * src/terminal.c (cursor_to, raw_cursor_to): Fix translation to root coordinates. (cherry picked from commit 8cbb3c7335ff03b6fae4efeae126e91993cb962a) --- diff --git a/src/terminal.c b/src/terminal.c index db6d42d4b4f..e6d5a5d309a 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -110,9 +110,13 @@ set_terminal_window (struct frame *f, int size) void cursor_to (struct frame *f, int vpos, int hpos) { - if (FRAME_TERMINAL (f)->cursor_to_hook) - (*FRAME_TERMINAL (f)->cursor_to_hook) (f, vpos + f->top_pos, - hpos + f->left_pos); + struct terminal *term = FRAME_TERMINAL (f); + if (term->cursor_to_hook) + { + int x, y; + root_xy (f, hpos, vpos, &x, &y); + term->cursor_to_hook (f, y, x); + } } /* Similar but don't take any account of the wasted characters. */ @@ -120,9 +124,13 @@ cursor_to (struct frame *f, int vpos, int hpos) void raw_cursor_to (struct frame *f, int row, int col) { - if (FRAME_TERMINAL (f)->raw_cursor_to_hook) - (*FRAME_TERMINAL (f)->raw_cursor_to_hook) (f, row + f->top_pos, - col + f->left_pos); + struct terminal *term = FRAME_TERMINAL (f); + if (term->raw_cursor_to_hook) + { + int x, y; + root_xy (f, row, col, &x, &y); + term->raw_cursor_to_hook (f, y, x); + } } /* Erase operations. */