0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 7.4.1890

Problem:    GUI: When channel data is received the cursor blinking is
            interrupted.  (Ramel Eshed)
Solution:   Don't update the cursor when it is blinking.
This commit is contained in:
Bram Moolenaar 2016-06-04 16:24:32 +02:00
parent 35d88f4e2f
commit 703a8044b5
12 changed files with 40 additions and 1 deletions

View File

@ -810,6 +810,12 @@ gui_gtk_is_blink_on(void)
} }
#endif #endif
int
gui_mch_is_blinking(void)
{
return blink_state != BLINK_NONE;
}
void void
gui_mch_set_blinking(long waittime, long on, long off) gui_mch_set_blinking(long waittime, long on, long off)
{ {

View File

@ -5114,6 +5114,11 @@ gui_mch_destroy_scrollbar(scrollbar_T *sb)
#endif #endif
} }
int
gui_mch_is_blinking(void)
{
return FALSE;
}
/* /*
* Cursor blink functions. * Cursor blink functions.

View File

@ -2232,6 +2232,12 @@ gui_mch_draw_part_cursor(int w, int h, guicolor_T color)
DRAW_END; DRAW_END;
} }
int
gui_mch_is_blinking(void)
{
return blink_state != BLINK_NONE;
}
void void
gui_mch_set_blinking(long wait, long on, long off) gui_mch_set_blinking(long wait, long on, long off)
{ {

View File

@ -540,6 +540,12 @@ static long_u blink_ontime = 400;
static long_u blink_offtime = 250; static long_u blink_offtime = 250;
static UINT blink_timer = 0; static UINT blink_timer = 0;
int
gui_mch_is_blinking(void)
{
return blink_state != BLINK_NONE;
}
void void
gui_mch_set_blinking(long wait, long on, long off) gui_mch_set_blinking(long wait, long on, long off)
{ {

View File

@ -3155,6 +3155,12 @@ static long_u blink_ontime = 400;
static long_u blink_offtime = 250; static long_u blink_offtime = 250;
static XtIntervalId blink_timer = (XtIntervalId)0; static XtIntervalId blink_timer = (XtIntervalId)0;
int
gui_mch_is_blinking(void)
{
return blink_state != BLINK_NONE;
}
void void
gui_mch_set_blinking(long waittime, long on, long off) gui_mch_set_blinking(long waittime, long on, long off)
{ {

View File

@ -1,6 +1,7 @@
/* gui_gtk_x11.c */ /* gui_gtk_x11.c */
void gui_mch_prepare(int *argc, char **argv); void gui_mch_prepare(int *argc, char **argv);
void gui_mch_free_all(void); void gui_mch_free_all(void);
int gui_mch_is_blinking(void);
void gui_mch_set_blinking(long waittime, long on, long off); void gui_mch_set_blinking(long waittime, long on, long off);
void gui_mch_stop_blink(void); void gui_mch_stop_blink(void);
void gui_mch_start_blink(void); void gui_mch_start_blink(void);

View File

@ -14,6 +14,7 @@ void gui_mac_handle_menu(long menuChoice);
void gui_mac_focus_change(EventRecord *event); void gui_mac_focus_change(EventRecord *event);
void gui_mac_update(EventRecord *event); void gui_mac_update(EventRecord *event);
short gui_mch_get_mac_menu_item_index(vimmenu_T *menu, vimmenu_T *parent); short gui_mch_get_mac_menu_item_index(vimmenu_T *menu, vimmenu_T *parent);
int gui_mch_is_blinking(void);
void gui_mch_set_blinking(long wait, long on, long off); void gui_mch_set_blinking(long wait, long on, long off);
void gui_mch_stop_blink(void); void gui_mch_stop_blink(void);
void gui_mch_start_blink(void); void gui_mch_start_blink(void);

View File

@ -39,6 +39,7 @@ void gui_mch_insert_lines(int row, int num_lines);
void gui_mch_draw_string(int row, int col, char_u *s, int len, int flags); void gui_mch_draw_string(int row, int col, char_u *s, int len, int flags);
void gui_mch_draw_hollow_cursor(guicolor_T color); void gui_mch_draw_hollow_cursor(guicolor_T color);
void gui_mch_draw_part_cursor(int w, int h, guicolor_T color); void gui_mch_draw_part_cursor(int w, int h, guicolor_T color);
int gui_mch_is_blinking(void);
void gui_mch_set_blinking(long wait, long on, long off); void gui_mch_set_blinking(long wait, long on, long off);
void gui_mch_start_blink(void); void gui_mch_start_blink(void);
void gui_mch_stop_blink(void); void gui_mch_stop_blink(void);

View File

@ -1,6 +1,7 @@
/* gui_w32.c */ /* gui_w32.c */
int directx_enabled(void); int directx_enabled(void);
int gui_mch_set_rendering_options(char_u *s); int gui_mch_set_rendering_options(char_u *s);
int gui_mch_is_blinking(void);
void gui_mch_set_blinking(long wait, long on, long off); void gui_mch_set_blinking(long wait, long on, long off);
void gui_mch_stop_blink(void); void gui_mch_stop_blink(void);
void gui_mch_start_blink(void); void gui_mch_start_blink(void);

View File

@ -53,6 +53,7 @@ void gui_mch_menu_grey(vimmenu_T *menu, int grey);
void gui_mch_menu_hidden(vimmenu_T *menu, int hidden); void gui_mch_menu_hidden(vimmenu_T *menu, int hidden);
void gui_mch_draw_menubar(void); void gui_mch_draw_menubar(void);
void gui_x11_menu_cb(Widget w, XtPointer client_data, XtPointer call_data); void gui_x11_menu_cb(Widget w, XtPointer client_data, XtPointer call_data);
int gui_mch_is_blinking(void);
void gui_mch_set_blinking(long waittime, long on, long off); void gui_mch_set_blinking(long waittime, long on, long off);
void gui_mch_stop_blink(void); void gui_mch_stop_blink(void);
void gui_mch_start_blink(void); void gui_mch_start_blink(void);

View File

@ -432,7 +432,10 @@ redraw_after_callback()
#ifdef FEAT_GUI #ifdef FEAT_GUI
if (gui.in_use) if (gui.in_use)
{ {
gui_update_cursor(TRUE, FALSE); /* Don't update the cursor while it is blinking, it will get
* updated soon and this avoids interrupting the blinking. */
if (!gui_mch_is_blinking())
gui_update_cursor(FALSE, FALSE);
gui_mch_flush(); gui_mch_flush();
} }
#endif #endif

View File

@ -753,6 +753,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1890,
/**/ /**/
1889, 1889,
/**/ /**/