Skip to content

Commit

Permalink
Fix cursor being hidden after reaching timeout
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kchibisov authored Nov 10, 2023
1 parent 5060f8e commit 7ea927f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Crash on exit when using NVIDIA binary drivers on Wayland
- `window.startup_mode` applied to window again when creating new tab
- Crash when leaving search after resize
- Cursor being hidden after reaching cursor blinking timeout

### Removed

Expand Down
8 changes: 6 additions & 2 deletions alacritty/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1266,8 +1266,12 @@ impl input::Processor<EventProxy, ActionContext<'_, Notifier, EventProxy>> {
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.
Expand Down

0 comments on commit 7ea927f

Please sign in to comment.