]> granicus.if.org Git - vim/commitdiff
patch 7.4.1995 v7.4.1995
authorBram Moolenaar <Bram@vim.org>
Thu, 7 Jul 2016 14:43:02 +0000 (16:43 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 7 Jul 2016 14:43:02 +0000 (16:43 +0200)
Problem:    GUI: cursor drawn in wrong place if a timer callback causes a
            screen update. (David Samvelyan)
Solution:   Also redraw the cursor when it's blinking and on.

12 files changed:
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

index 620c89228358d9903c2e759d0b3dd983b568cfe2..39b918ab833298bc852604fb67b0ea8229f06151 100644 (file)
@@ -818,6 +818,12 @@ gui_mch_is_blinking(void)
     return blink_state != BLINK_NONE;
 }
 
+    int
+gui_mch_is_blink_off(void)
+{
+    return blink_state == BLINK_OFF;
+}
+
     void
 gui_mch_set_blinking(long waittime, long on, long off)
 {
index 06f92044b9e7e2317d6d72a5d1ec26154baa40cb..b2e4d4b3f7d415034529dd44f8fd24d3d36997e4 100644 (file)
@@ -5116,6 +5116,12 @@ gui_mch_destroy_scrollbar(scrollbar_T *sb)
 
     int
 gui_mch_is_blinking(void)
+{
+    return FALSE;
+}
+
+    int
+gui_mch_is_blink_off(void)
 {
     return FALSE;
 }
index a4d00f7830a79e5c1f060821f70391f9039c292f..1000a5eb5aee320fc717c0613521452c2dace4eb 100644 (file)
@@ -2238,6 +2238,12 @@ gui_mch_is_blinking(void)
     return blink_state != BLINK_NONE;
 }
 
+    int
+gui_mch_is_blink_off(void)
+{
+    return blink_state == BLINK_OFF;
+}
+
     void
 gui_mch_set_blinking(long wait, long on, long off)
 {
index cf29b610c3b4e2ce4b4852f22d4056453bec66ef..19f4d65002e7a0b00b2f552a7a630fa5621abc9a 100644 (file)
@@ -546,6 +546,12 @@ gui_mch_is_blinking(void)
     return blink_state != BLINK_NONE;
 }
 
+    int
+gui_mch_is_blink_off(void)
+{
+    return blink_state == BLINK_OFF;
+}
+
     void
 gui_mch_set_blinking(long wait, long on, long off)
 {
index deed76e9e58c73877664f40a173116f6f9d1df4f..3ccc92a5539d23baf8785d374717a7922bcb3762 100644 (file)
@@ -3161,6 +3161,12 @@ gui_mch_is_blinking(void)
     return blink_state != BLINK_NONE;
 }
 
+    int
+gui_mch_is_blink_off(void)
+{
+    return blink_state == BLINK_OFF;
+}
+
     void
 gui_mch_set_blinking(long waittime, long on, long off)
 {
index 3735f8d315ca9400d46e1c478250c85da9031805..b79feb8e4ecc9af2e2488284efccb75afe756d28 100644 (file)
@@ -2,6 +2,7 @@
 void gui_mch_prepare(int *argc, char **argv);
 void gui_mch_free_all(void);
 int gui_mch_is_blinking(void);
+int gui_mch_is_blink_off(void);
 void gui_mch_set_blinking(long waittime, long on, long off);
 void gui_mch_stop_blink(void);
 void gui_mch_start_blink(void);
index ff837594b1ec26f3547fccedb715f86235153400..ebe13f3300d98009b2c16d967c0f1539cbeb1ad2 100644 (file)
@@ -15,6 +15,7 @@ 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);
+int gui_mch_is_blink_off(void);
 void gui_mch_set_blinking(long wait, long on, long off);
 void gui_mch_stop_blink(void);
 void gui_mch_start_blink(void);
index 46d73b741901693c467354ca829476a5f8bf0a68..b03479c97403e1ec4582c56bc0789157b582925b 100644 (file)
@@ -40,6 +40,7 @@ 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);
+int gui_mch_is_blink_off(void);
 void gui_mch_set_blinking(long wait, long on, long off);
 void gui_mch_start_blink(void);
 void gui_mch_stop_blink(void);
index e35373c6097d335e419aaf7f3068d38ce863b8c4..20a92b974630ad2d9aa6434cfc52c95a0584cb0a 100644 (file)
@@ -2,6 +2,7 @@
 int directx_enabled(void);
 int gui_mch_set_rendering_options(char_u *s);
 int gui_mch_is_blinking(void);
+int gui_mch_is_blink_off(void);
 void gui_mch_set_blinking(long wait, long on, long off);
 void gui_mch_stop_blink(void);
 void gui_mch_start_blink(void);
index 2d2eafadeb172c0b0e4456f58859377c8390c56d..ccaf99fd4821b9515eac1f0c64dd33958bd0d3eb 100644 (file)
@@ -54,6 +54,7 @@ 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);
+int gui_mch_is_blink_off(void);
 void gui_mch_set_blinking(long waittime, long on, long off);
 void gui_mch_stop_blink(void);
 void gui_mch_start_blink(void);
index 684401cd2930983eb10fbc98d3b3ffee35de20cf..2f08afb7a828b0899d2472139faa14047c0a787f 100644 (file)
@@ -432,9 +432,9 @@ redraw_after_callback(void)
 #ifdef FEAT_GUI
     if (gui.in_use)
     {
-       /* 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())
+       /* Don't update the cursor when it is blinking and off to avoid
+        * flicker. */
+       if (!gui_mch_is_blink_off())
            gui_update_cursor(FALSE, FALSE);
        gui_mch_flush();
     }
index 8bb497d0278e2793b632ac304ff59e5d96bb379c..f34f7a0a79f91e65ed1104887416173aca86cdc1 100644 (file)
@@ -758,6 +758,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1995,
 /**/
     1994,
 /**/