diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-07-07 16:43:02 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-07-07 16:43:02 +0200 |
commit | 9d5d3c9c4468ad76f16b50eabd3d9e7eab2ed44d (patch) | |
tree | ecee7bf2e2c8a5eeaea1c00ab3461d34740b3ca6 /src | |
parent | 05e418d436410cd8bbf5a29ff81e8ad68408b1e8 (diff) | |
download | vim-git-9d5d3c9c4468ad76f16b50eabd3d9e7eab2ed44d.tar.gz |
patch 7.4.1995v7.4.1995
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui_gtk_x11.c | 6 | ||||
-rw-r--r-- | src/gui_mac.c | 6 | ||||
-rw-r--r-- | src/gui_photon.c | 6 | ||||
-rw-r--r-- | src/gui_w32.c | 6 | ||||
-rw-r--r-- | src/gui_x11.c | 6 | ||||
-rw-r--r-- | src/proto/gui_gtk_x11.pro | 1 | ||||
-rw-r--r-- | src/proto/gui_mac.pro | 1 | ||||
-rw-r--r-- | src/proto/gui_photon.pro | 1 | ||||
-rw-r--r-- | src/proto/gui_w32.pro | 1 | ||||
-rw-r--r-- | src/proto/gui_x11.pro | 1 | ||||
-rw-r--r-- | src/screen.c | 6 | ||||
-rw-r--r-- | src/version.c | 2 |
12 files changed, 40 insertions, 3 deletions
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c index 620c89228..39b918ab8 100644 --- a/src/gui_gtk_x11.c +++ b/src/gui_gtk_x11.c @@ -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) { diff --git a/src/gui_mac.c b/src/gui_mac.c index 06f92044b..b2e4d4b3f 100644 --- a/src/gui_mac.c +++ b/src/gui_mac.c @@ -5120,6 +5120,12 @@ gui_mch_is_blinking(void) return FALSE; } + int +gui_mch_is_blink_off(void) +{ + return FALSE; +} + /* * Cursor blink functions. * diff --git a/src/gui_photon.c b/src/gui_photon.c index a4d00f783..1000a5eb5 100644 --- a/src/gui_photon.c +++ b/src/gui_photon.c @@ -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) { diff --git a/src/gui_w32.c b/src/gui_w32.c index cf29b610c..19f4d6500 100644 --- a/src/gui_w32.c +++ b/src/gui_w32.c @@ -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) { diff --git a/src/gui_x11.c b/src/gui_x11.c index deed76e9e..3ccc92a55 100644 --- a/src/gui_x11.c +++ b/src/gui_x11.c @@ -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) { diff --git a/src/proto/gui_gtk_x11.pro b/src/proto/gui_gtk_x11.pro index 3735f8d31..b79feb8e4 100644 --- a/src/proto/gui_gtk_x11.pro +++ b/src/proto/gui_gtk_x11.pro @@ -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); diff --git a/src/proto/gui_mac.pro b/src/proto/gui_mac.pro index ff837594b..ebe13f330 100644 --- a/src/proto/gui_mac.pro +++ b/src/proto/gui_mac.pro @@ -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); diff --git a/src/proto/gui_photon.pro b/src/proto/gui_photon.pro index 46d73b741..b03479c97 100644 --- a/src/proto/gui_photon.pro +++ b/src/proto/gui_photon.pro @@ -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); diff --git a/src/proto/gui_w32.pro b/src/proto/gui_w32.pro index e35373c60..20a92b974 100644 --- a/src/proto/gui_w32.pro +++ b/src/proto/gui_w32.pro @@ -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); diff --git a/src/proto/gui_x11.pro b/src/proto/gui_x11.pro index 2d2eafade..ccaf99fd4 100644 --- a/src/proto/gui_x11.pro +++ b/src/proto/gui_x11.pro @@ -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); diff --git a/src/screen.c b/src/screen.c index 684401cd2..2f08afb7a 100644 --- a/src/screen.c +++ b/src/screen.c @@ -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(); } diff --git a/src/version.c b/src/version.c index 8bb497d02..f34f7a0a7 100644 --- a/src/version.c +++ b/src/version.c @@ -759,6 +759,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1995, +/**/ 1994, /**/ 1993, |