if (tty->cursor_hidden == 0)
{
tty->cursor_hidden = 1;
+#ifdef WINDOWSNT
+ w32con_hide_cursor ();
+#else
OUTPUT_IF (tty, tty->TS_cursor_invisible);
+#endif
}
}
if (tty->cursor_hidden)
{
tty->cursor_hidden = 0;
+#ifdef WINDOWSNT
+ w32con_show_cursor ();
+#else
OUTPUT_IF (tty, tty->TS_cursor_normal);
if (visible_cursor)
OUTPUT_IF (tty, tty->TS_cursor_visible);
+#endif
}
}
int title_faces[4]; /* face to display the menu title */
int faces[4], buffers_num_deleted = 0;
struct frame *sf = SELECTED_FRAME ();
+ struct tty_display_info *tty = FRAME_TTY (sf);
bool first_time;
Lisp_Object saved_echo_area_message, selectface;
/* Turn off the cursor. Otherwise it shows through the menu
panes, which is ugly. */
-#if 0
- show_cursor (0); /* FIXME: need a new hook, for w32console. */
-#endif
+ tty_hide_cursor (tty);
/* Display the menu title. We subtract 1 from x0 and y0 because we
want to interpret them as zero-based column and row coordinates,
{
help_callback (menu_help_message,
menu_help_paneno, menu_help_itemno);
-#if 0
- show_cursor (0); /* FIXME */
-#endif
+ tty_hide_cursor (tty);
prev_menu_help_message = menu_help_message;
}
/* We are busy-waiting for the mouse to move, so let's be nice
#endif
while (statecount--)
free_saved_screen (state[statecount].screen_behind);
-#if 0
- show_cursor (1); /* turn cursor back on */
-#endif
- /* Clean up any mouse events that are waiting inside Emacs event queue.
+ tty_show_cursor (tty); /* turn cursor back on */
+
+/* Clean up any mouse events that are waiting inside Emacs event queue.
These events are likely to be generated before the menu was even
displayed, probably because the user pressed and released the button
(which invoked the menu) too quickly. If we don't remove these events,
static WORD char_attr_normal;
static DWORD prev_console_mode;
+static CONSOLE_CURSOR_INFO console_cursor_info;
#ifndef USE_SEPARATE_SCREEN
static CONSOLE_CURSOR_INFO prev_console_cursor;
#endif
SetConsoleCursorPosition (cur_screen, cursor_coords);
}
+void
+w32con_hide_cursor (void)
+{
+ GetConsoleCursorInfo (cur_screen, &console_cursor_info);
+ console_cursor_info.bVisible = FALSE;
+ SetConsoleCursorInfo (cur_screen, &console_cursor_info);
+}
+
+void
+w32con_show_cursor (void)
+{
+ GetConsoleCursorInfo (cur_screen, &console_cursor_info);
+ console_cursor_info.bVisible = TRUE;
+ SetConsoleCursorInfo (cur_screen, &console_cursor_info);
+}
+
/* Clear from cursor to end of screen. */
static void
w32con_clear_to_end (struct frame *f)