display_tty_menu_item (menu->text[j], max_width, face, x, y + i,
menu->submenu[j] != NULL);
}
- update_frame_with_menu (sf);
- cursor_to (sf, row, col);
+ update_frame_with_menu (sf, row, col);
}
/* --------------------------- X Menu emulation ---------------------- */
screen_update (struct frame *f, struct glyph_matrix *mtx)
{
restore_desired_matrix (f, mtx);
- update_frame_with_menu (f);
+ update_frame_with_menu (f, -1, -1);
}
typedef enum {
/* Force update of the current frame, so that the desired and the
current matrices are identical. */
- update_frame_with_menu (sf);
+ update_frame_with_menu (sf, -1, -1);
state[0].menu = menu;
state[0].screen_behind = save_and_enable_current_matrix (sf);
/* Turn off the cursor. Otherwise it shows through the menu
panes, which is ugly. */
+ col = cursorX (tty);
+ row = cursorY (tty);
tty_hide_cursor (tty);
+
if (buffers_num_deleted)
menu->text[0][7] = ' ';
onepane = menu->count == 1 && menu->submenu[0];
state[statecount - 1].y,
state[statecount - 1].pane,
faces, x, y, first_item, 1);
- tty_hide_cursor (tty);
- fflush (tty->output);
/* The call to display help-echo below will move the cursor,
so remember its current position as computed by
tty_menu_display. */
col = cursorX (tty);
row = cursorY (tty);
}
- else
- row = -1;
/* Display the help-echo message for the currently-selected menu
item. */
/* Move the cursor to the beginning of the current menu
item, so that screen readers and other accessibility aids
know where the active region is. */
- if (0 <= row)
- cursor_to (sf, row, col);
- tty_hide_cursor (tty);
- fflush (tty->output);
+ cursor_to (sf, row, col);
prev_menu_help_message = menu_help_message;
}
+ /* Both tty_menu_display and help_callback invoke update_end,
+ which calls tty_show_cursor. Re-hide it, so it doesn't show
+ through the menus. */
+ tty_hide_cursor (tty);
+ fflush (tty->output);
}
sf->mouse_moved = 0;