Fix cursor visibility when window lost focus

This commit is contained in:
Tuomas Siipola 2017-02-22 22:59:01 +02:00 committed by Joe Wilm
parent 3cc27a4d76
commit 2d89f79a29
1 changed files with 6 additions and 1 deletions

View File

@ -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;
},
_ => (),
}
}