summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTuomas Siipola <siiptuo@kapsi.fi>2017-02-22 22:59:01 +0200
committerJoe Wilm <jwilm@users.noreply.github.com>2017-02-22 14:49:29 -0800
commit2d89f79a297bf8439db9cf0c2853925eb5aa04ae (patch)
treeb7990f6c89070aa74ca78fc8459ffc0a959979b6 /src
parent3cc27a4d767a87c617b5213810dfce254bac1131 (diff)
Fix cursor visibility when window lost focus
Diffstat (limited to 'src')
-rw-r--r--src/event.rs7
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;
+ },
_ => (),
}
}