summaryrefslogtreecommitdiffstats
path: root/src/gui_gtk_x11.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-01-31 21:10:01 +0100
committerBram Moolenaar <Bram@vim.org>2018-01-31 21:10:01 +0100
commit1dd45fb4f3371f0256653b2186c8b4b3d26b3f41 (patch)
tree1a98ce1bfba438843ef01ee54267da7fdd37b47e /src/gui_gtk_x11.c
parenta338adcf222b6a24e26ea5ae6a2ad27f914acb38 (diff)
patch 8.0.1450: GUI: endless loop when stopping cursor blinkingv8.0.1450
Problem: Endless loop when gui_mch_stop_blink() is called while blink_state is BLINK_OFF. (zdohnal) Solution: Avoid calling gui_update_cursor() recursively.
Diffstat (limited to 'src/gui_gtk_x11.c')
-rw-r--r--src/gui_gtk_x11.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
index 83b98e187f..ad51be62c7 100644
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -893,14 +893,14 @@ gui_mch_set_blinking(long waittime, long on, long off)
* Stop the cursor blinking. Show the cursor if it wasn't shown.
*/
void
-gui_mch_stop_blink(void)
+gui_mch_stop_blink(int may_call_gui_update_cursor)
{
if (blink_timer)
{
timeout_remove(blink_timer);
blink_timer = 0;
}
- if (blink_state == BLINK_OFF)
+ if (blink_state == BLINK_OFF && may_call_gui_update_cursor)
{
gui_update_cursor(TRUE, FALSE);
gui_mch_flush();
@@ -975,7 +975,7 @@ leave_notify_event(GtkWidget *widget UNUSED,
gpointer data UNUSED)
{
if (blink_state != BLINK_NONE)
- gui_mch_stop_blink();
+ gui_mch_stop_blink(TRUE);
return FALSE;
}
@@ -1006,7 +1006,7 @@ focus_out_event(GtkWidget *widget UNUSED,
gui_focus_change(FALSE);
if (blink_state != BLINK_NONE)
- gui_mch_stop_blink();
+ gui_mch_stop_blink(TRUE);
return TRUE;
}
@@ -1145,7 +1145,7 @@ key_press_event(GtkWidget *widget UNUSED,
#if GTK_CHECK_VERSION(3,0,0)
is_key_pressed = TRUE;
- gui_mch_stop_blink();
+ gui_mch_stop_blink(TRUE);
#endif
gui.event_time = event->time;
@@ -6677,7 +6677,7 @@ gui_mch_wait_for_chars(long wtime)
if (gui.in_focus)
gui_mch_start_blink();
else
- gui_mch_stop_blink();
+ gui_mch_stop_blink(TRUE);
focus = gui.in_focus;
}