* src/puresize.h (BASE_PURESIZE): Bump by another 1K.
[bpt/emacs.git] / src / term.c
index 3bbb21f..8661cba 100644 (file)
@@ -2907,8 +2907,7 @@ tty_menu_display (tty_menu *menu, int x, int y, int pn, int *faces,
       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 ---------------------- */
@@ -3079,7 +3078,7 @@ static void
 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 {
@@ -3228,7 +3227,7 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
 
   /* 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);
 
@@ -3240,7 +3239,10 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
 
   /* 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];
@@ -3370,16 +3372,12 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
                            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.  */
@@ -3391,12 +3389,14 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
          /* 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;