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.
This commit is contained in:
Kirill Chibisov 2023-11-10 21:09:43 +04:00 committed by GitHub
parent 5060f8eeb8
commit 7ea927ffc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -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

View File

@ -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 => {
// 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.