summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2023-11-10 21:09:43 +0400
committerGitHub <noreply@github.com>2023-11-10 21:09:43 +0400
commit7ea927ffc1b345216d65be5154f0ec68cd243890 (patch)
tree4495fdd458c2c7c63f8643bf2b66667ad6f24865
parent5060f8eeb864e8c304fbad9588bdd882db942356 (diff)
downloadalacritty-7ea927ffc1b345216d65be5154f0ec68cd243890.tar.gz
alacritty-7ea927ffc1b345216d65be5154f0ec68cd243890.zip
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.
-rw-r--r--CHANGELOG.md1
-rw-r--r--alacritty/src/event.rs8
2 files changed, 7 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 83779473..51588864 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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
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<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.