From 2d89f79a297bf8439db9cf0c2853925eb5aa04ae Mon Sep 17 00:00:00 2001 From: Tuomas Siipola Date: Wed, 22 Feb 2017 22:59:01 +0200 Subject: [PATCH] Fix cursor visibility when window lost focus --- src/event.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 Processor { 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 Processor { glutin::Event::Awakened => { processor.ctx.terminal.dirty = true; }, + glutin::Event::Focused(false) => { + *hide_cursor = false; + }, _ => (), } }