changeset 9213:bb86514cad15 v7.4.1890

commit https://github.com/vim/vim/commit/703a8044b5393d37d355b0b1054a9a5a13912a3f Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jun 4 16:24:32 2016 +0200 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.
author Christian Brabandt <cb@256bit.org>
date Sat, 04 Jun 2016 16:30:05 +0200
parents ac88df1cd99a
children 62bb9d601762
files src/gui_gtk_x11.c src/gui_mac.c src/gui_photon.c src/gui_w32.c src/gui_x11.c src/proto/gui_gtk_x11.pro src/proto/gui_mac.pro src/proto/gui_photon.pro src/proto/gui_w32.pro src/proto/gui_x11.pro src/screen.c src/version.c
diffstat 12 files changed, 40 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -810,6 +810,12 @@ gui_gtk_is_blink_on(void)
 }
 #endif
 
+    int
+gui_mch_is_blinking(void)
+{
+    return blink_state != BLINK_NONE;
+}
+
     void
 gui_mch_set_blinking(long waittime, long on, long off)
 {
--- a/src/gui_mac.c
+++ b/src/gui_mac.c
@@ -5114,6 +5114,11 @@ gui_mch_destroy_scrollbar(scrollbar_T *s
 #endif
 }
 
+    int
+gui_mch_is_blinking(void)
+{
+    return FALSE;
+}
 
 /*
  * Cursor blink functions.
--- a/src/gui_photon.c
+++ b/src/gui_photon.c
@@ -2232,6 +2232,12 @@ gui_mch_draw_part_cursor(int w, int h, g
     DRAW_END;
 }
 
+    int
+gui_mch_is_blinking(void)
+{
+    return blink_state != BLINK_NONE;
+}
+
     void
 gui_mch_set_blinking(long wait, long on, long off)
 {
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -540,6 +540,12 @@ static long_u		blink_ontime = 400;
 static long_u		blink_offtime = 250;
 static UINT		blink_timer = 0;
 
+    int
+gui_mch_is_blinking(void)
+{
+    return blink_state != BLINK_NONE;
+}
+
     void
 gui_mch_set_blinking(long wait, long on, long off)
 {
--- a/src/gui_x11.c
+++ b/src/gui_x11.c
@@ -3155,6 +3155,12 @@ static long_u		blink_ontime = 400;
 static long_u		blink_offtime = 250;
 static XtIntervalId	blink_timer = (XtIntervalId)0;
 
+    int
+gui_mch_is_blinking(void)
+{
+    return blink_state != BLINK_NONE;
+}
+
     void
 gui_mch_set_blinking(long waittime, long on, long off)
 {
--- a/src/proto/gui_gtk_x11.pro
+++ b/src/proto/gui_gtk_x11.pro
@@ -1,6 +1,7 @@
 /* gui_gtk_x11.c */
 void gui_mch_prepare(int *argc, char **argv);
 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_stop_blink(void);
 void gui_mch_start_blink(void);
--- a/src/proto/gui_mac.pro
+++ b/src/proto/gui_mac.pro
@@ -14,6 +14,7 @@ void gui_mac_handle_menu(long menuChoice
 void gui_mac_focus_change(EventRecord *event);
 void gui_mac_update(EventRecord *event);
 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_stop_blink(void);
 void gui_mch_start_blink(void);
--- a/src/proto/gui_photon.pro
+++ b/src/proto/gui_photon.pro
@@ -39,6 +39,7 @@ void gui_mch_insert_lines(int row, int n
 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_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_start_blink(void);
 void gui_mch_stop_blink(void);
--- a/src/proto/gui_w32.pro
+++ b/src/proto/gui_w32.pro
@@ -1,6 +1,7 @@
 /* gui_w32.c */
 int directx_enabled(void);
 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_stop_blink(void);
 void gui_mch_start_blink(void);
--- a/src/proto/gui_x11.pro
+++ b/src/proto/gui_x11.pro
@@ -53,6 +53,7 @@ void gui_mch_menu_grey(vimmenu_T *menu, 
 void gui_mch_menu_hidden(vimmenu_T *menu, int hidden);
 void gui_mch_draw_menubar(void);
 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_stop_blink(void);
 void gui_mch_start_blink(void);
--- a/src/screen.c
+++ b/src/screen.c
@@ -432,7 +432,10 @@ redraw_after_callback()
 #ifdef FEAT_GUI
     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();
     }
 #endif
--- a/src/version.c
+++ b/src/version.c
@@ -754,6 +754,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1890,
+/**/
     1889,
 /**/
     1888,