aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Möllmann2025-01-25 05:44:03 +0100
committerGerd Möllmann2025-01-25 07:35:51 +0100
commit8cbb3c7335ff03b6fae4efeae126e91993cb962a (patch)
treecedfada3a2b18513c2dd855a148f97b4dc172bd6
parent5e132835ad320be1d5c45ffbf83d67d16fc7bf96 (diff)
downloademacs-8cbb3c7335ff03b6fae4efeae126e91993cb962a.tar.gz
emacs-8cbb3c7335ff03b6fae4efeae126e91993cb962a.zip
Fix cursor positioning of nested tty child frames
* src/terminal.c (cursor_to, raw_cursor_to): Fix translation to root coordinates.
-rw-r--r--src/terminal.c20
1 files changed, 14 insertions, 6 deletions
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)
110void 110void
111cursor_to (struct frame *f, int vpos, int hpos) 111cursor_to (struct frame *f, int vpos, int hpos)
112{ 112{
113 if (FRAME_TERMINAL (f)->cursor_to_hook) 113 struct terminal *term = FRAME_TERMINAL (f);
114 (*FRAME_TERMINAL (f)->cursor_to_hook) (f, vpos + f->top_pos, 114 if (term->cursor_to_hook)
115 hpos + f->left_pos); 115 {
116 int x, y;
117 root_xy (f, hpos, vpos, &x, &y);
118 term->cursor_to_hook (f, y, x);
119 }
116} 120}
117 121
118/* Similar but don't take any account of the wasted characters. */ 122/* Similar but don't take any account of the wasted characters. */
@@ -120,9 +124,13 @@ cursor_to (struct frame *f, int vpos, int hpos)
120void 124void
121raw_cursor_to (struct frame *f, int row, int col) 125raw_cursor_to (struct frame *f, int row, int col)
122{ 126{
123 if (FRAME_TERMINAL (f)->raw_cursor_to_hook) 127 struct terminal *term = FRAME_TERMINAL (f);
124 (*FRAME_TERMINAL (f)->raw_cursor_to_hook) (f, row + f->top_pos, 128 if (term->raw_cursor_to_hook)
125 col + f->left_pos); 129 {
130 int x, y;
131 root_xy (f, row, col, &x, &y);
132 term->raw_cursor_to_hook (f, y, x);
133 }
126} 134}
127 135
128/* Erase operations. */ 136/* Erase operations. */