static void mirror_line_dance (struct window *, int, int, int *, char *);
static void update_window_tree (struct window *);
static void update_window (struct window *);
-static void write_matrix (struct frame *, bool, bool, bool);
+static void write_matrix (struct frame *, bool, bool);
static void scrolling (struct frame *);
static void set_window_cursor_after_update (struct window *);
static void adjust_frame_glyphs_for_window_redisplay (struct frame *);
static void adjust_frame_glyphs_for_frame_redisplay (struct frame *);
static void set_window_update_flags (struct window *w, bool on_p);
+static void tty_set_cursor (struct frame *f);
+
#if 0 /* Please leave this in as a debugging aid. */
static void
}
update_begin (root);
- write_matrix (root, inhibit_scrolling, 1, false);
+ write_matrix (root, inhibit_scrolling, false);
make_matrix_current (root);
update_end (root);
+ /* The selected frame determines where the cursor on ttys goes, except
+ when it is a frame that is completely unrelated to the frame being
+ displayed. This can happen with multi-tty, when the selected frame
+ can be a window-system frame. */
+ if (frame_ancestor_p (root, SELECTED_FRAME ()))
+ tty_set_cursor (SELECTED_FRAME ());
+ else
+ tty_set_cursor (root);
+
/* If a child is displayed, and the cursor is displayed in another
frame, the child might lay above the cursor, so that it appears to
"shine through" the child. Avoid that because it's confusing. */
update_frame_with_menu (struct frame *f, int row, int col)
{
struct window *root_window = XWINDOW (f->root_window);
- bool cursor_at_point_p;
eassert (FRAME_TERMCAP_P (f));
/* Update the display. */
update_begin (f);
- cursor_at_point_p = !(row >= 0 && col >= 0);
- /* Do not stop due to pending input, and do not try scrolling. This
- means that write_glyphs will always return false. */
- write_matrix (f, 1, cursor_at_point_p, true);
+ write_matrix (f, true, true);
make_matrix_current (f);
clear_desired_matrices (f);
/* ROW and COL tell us where in the menu to position the cursor, so
that screen readers know the active region on the screen. */
- if (!cursor_at_point_p)
+ if (row >= 0 && col >= 0)
cursor_to (f, row, col);
+ else
+ tty_set_cursor (f);
update_end (f);
flush_terminal (f);
}
}
-/* Write desired matix of tty frame F and make it current.
+/* Write desired matrix of tty frame F and make it current.
INHIBIT_ID_P means that scrolling by insert/delete should not be tried.
- SET_CURSOR_P false means do not set cursor at point in selected window. */
+ UPDATING_MENU_P true means we are called for updating a tty menu. */
static void
-write_matrix (struct frame *f, bool inhibit_id_p,
- bool set_cursor_p, bool updating_menu_p)
+write_matrix (struct frame *f, bool inhibit_id_p, bool updating_menu_p)
{
/* If we cannot insert/delete lines, it's no use trying it. */
if (!FRAME_LINE_INS_DEL_OK (f))
for (int i = first_row; i < last_row; ++i)
if (MATRIX_ROW_ENABLED_P (f->desired_matrix, i))
write_row (f, i, updating_menu_p);
-
- /* Now just clean up termcap drivers and set cursor, etc. */
- if (set_cursor_p)
- tty_set_cursor (f);
}
/* Do line insertions/deletions on frame F for frame-based redisplay. */