patch 8.0.1450: GUI: endless loop when stopping cursor blinking
Problem: Endless loop when gui_mch_stop_blink() is called while blink_state
is BLINK_OFF. (zdohnal)
Solution: Avoid calling gui_update_cursor() recursively.
diff --git a/src/gui_x11.c b/src/gui_x11.c
index ee48fb3..34d584e 100644
--- a/src/gui_x11.c
+++ b/src/gui_x11.c
@@ -2746,7 +2746,7 @@
if (gui.in_focus)
gui_mch_start_blink();
else
- gui_mch_stop_blink();
+ gui_mch_stop_blink(TRUE);
focus = gui.in_focus;
}
@@ -3105,14 +3105,14 @@
* 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 != (XtIntervalId)0)
{
XtRemoveTimeOut(blink_timer);
blink_timer = (XtIntervalId)0;
}
- if (blink_state == BLINK_OFF)
+ if (blink_state == BLINK_OFF && may_call_gui_update_cursor)
gui_update_cursor(TRUE, FALSE);
blink_state = BLINK_NONE;
}