mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-02 20:12:48 -05:00
Windows: cope if caret blinking is disabled.
On Windows, when a blinking cursor is enabled, PuTTY uses the system default blink time from GetCaretBlinkTime(), which can be configured in Control Panel. Control Panel allows caret blinking to be disabled entirely, in which case GetCaretBlinkTime() returns INFINITE. PuTTY wasn't handling this case; if cursor blinking was enabled in PuTTY but disabled at the system level, the terminal window would hang, blinking the cursor madly.
This commit is contained in:
@ -1381,9 +1381,10 @@ static void term_schedule_tblink(Terminal *term)
|
||||
*/
|
||||
static void term_schedule_cblink(Terminal *term)
|
||||
{
|
||||
if (term->blink_cur && term->has_focus) {
|
||||
int delay = CBLINK_DELAY;
|
||||
if (term->blink_cur && term->has_focus && delay > 0) {
|
||||
if (!term->cblink_pending)
|
||||
term->next_cblink = schedule_timer(CBLINK_DELAY, term_timer, term);
|
||||
term->next_cblink = schedule_timer(delay, term_timer, term);
|
||||
term->cblink_pending = true;
|
||||
} else {
|
||||
term->cblinker = true; /* reset when not in use */
|
||||
|
Reference in New Issue
Block a user