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. */
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. */