diff options
author | Tuomas Siipola <siiptuo@kapsi.fi> | 2017-02-22 22:59:01 +0200 |
---|---|---|
committer | Joe Wilm <jwilm@users.noreply.github.com> | 2017-02-22 14:49:29 -0800 |
commit | 2d89f79a297bf8439db9cf0c2853925eb5aa04ae (patch) | |
tree | b7990f6c89070aa74ca78fc8459ffc0a959979b6 | |
parent | 3cc27a4d767a87c617b5213810dfce254bac1131 (diff) | |
download | alacritty-2d89f79a297bf8439db9cf0c2853925eb5aa04ae.tar.gz alacritty-2d89f79a297bf8439db9cf0c2853925eb5aa04ae.zip |
Fix cursor visibility when window lost focus
-rw-r--r-- | src/event.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/event.rs b/src/event.rs index fd33bfb3..c385e289 100644 --- a/src/event.rs +++ b/src/event.rs @@ -224,7 +224,9 @@ impl<N: Notify> Processor<N> { processor.ctx.terminal.dirty = true; }, glutin::Event::KeyboardInput(state, _code, key, mods, string) => { - *hide_cursor = true; + if state == ElementState::Pressed { + *hide_cursor = true; + } processor.process_key(state, key, mods, string); }, glutin::Event::MouseInput(state, button) => { @@ -252,6 +254,9 @@ impl<N: Notify> Processor<N> { glutin::Event::Awakened => { processor.ctx.terminal.dirty = true; }, + glutin::Event::Focused(false) => { + *hide_cursor = false; + }, _ => (), } } |