From 7ea927ffc1b345216d65be5154f0ec68cd243890 Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Fri, 10 Nov 2023 21:09:43 +0400 Subject: Fix cursor being hidden after reaching timeout The timeout and blink events could be delivered at the same time, so canceling blinking won't work and we'll still have an event. --- alacritty/src/event.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'alacritty/src') diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs index d710c826..3dc1a262 100644 --- a/alacritty/src/event.rs +++ b/alacritty/src/event.rs @@ -1266,8 +1266,12 @@ impl input::Processor> { EventType::SearchNext => self.ctx.goto_match(None), EventType::Scroll(scroll) => self.ctx.scroll(scroll), EventType::BlinkCursor => { - self.ctx.display.cursor_hidden ^= true; - *self.ctx.dirty = true; + // Only change state when timeout isn't reached, since we could get + // BlinkCursor and BlinkCursorTimeout events at the same time. + if !*self.ctx.cursor_blink_timed_out { + self.ctx.display.cursor_hidden ^= true; + *self.ctx.dirty = true; + } }, EventType::BlinkCursorTimeout => { // Disable blinking after timeout reached. -- cgit