aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Herberth <github@dav1d.de>2020-05-06 23:58:43 +0200
committerGitHub <noreply@github.com>2020-05-06 21:58:43 +0000
commitbecd7cf459c5420a4f77764dfe81d50b332af6f2 (patch)
tree6e959b6554c08b4479df32d24610b95b0fc57172
parent81ce93574f62d4b117fdd79af65391f30316a457 (diff)
downloadr-alacritty-becd7cf459c5420a4f77764dfe81d50b332af6f2.tar.gz
r-alacritty-becd7cf459c5420a4f77764dfe81d50b332af6f2.tar.bz2
r-alacritty-becd7cf459c5420a4f77764dfe81d50b332af6f2.zip
Don't hide cursor on modifier press
Fixes #2761.
-rw-r--r--CHANGELOG.md1
-rw-r--r--alacritty/src/event.rs6
-rw-r--r--alacritty/src/input.rs16
3 files changed, 16 insertions, 7 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index eda674f5..4d956ab0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Wayland client side decorations are now based on config colorscheme
- Low resolution window decoration icon on Windows
- Mouse bindings for additional buttons need to be specified as a number not a string
+- Don't hide cursor on modifier press with `mouse.hide_when_typing` enabled
### Fixed
diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs
index 88d074bb..9a625a91 100644
--- a/alacritty/src/event.rs
+++ b/alacritty/src/event.rs
@@ -590,12 +590,6 @@ impl<N: Notify + OnResize> Processor<N> {
},
WindowEvent::KeyboardInput { input, is_synthetic: false, .. } => {
processor.key_input(input);
- if input.state == ElementState::Pressed {
- // Hide cursor while typing.
- if processor.ctx.config.ui_config.mouse.hide_when_typing {
- processor.ctx.window.set_mouse_visible(false);
- }
- }
},
WindowEvent::ReceivedCharacter(c) => processor.received_char(c),
WindowEvent::MouseInput { state, button, .. } => {
diff --git a/alacritty/src/input.rs b/alacritty/src/input.rs
index 6de9b6d9..f5f4106c 100644
--- a/alacritty/src/input.rs
+++ b/alacritty/src/input.rs
@@ -128,6 +128,10 @@ impl<T: EventListener> Execute<T> for Action {
fn execute<A: ActionContext<T>>(&self, ctx: &mut A) {
match *self {
Action::Esc(ref s) => {
+ if ctx.config().ui_config.mouse.hide_when_typing {
+ ctx.window_mut().set_mouse_visible(false);
+ }
+
ctx.clear_selection();
ctx.scroll(Scroll::Bottom);
ctx.write_to_pty(s.clone().into_bytes())
@@ -171,7 +175,13 @@ impl<T: EventListener> Execute<T> for Action {
ctx.launch_url(url);
}
},
- Action::ViMotion(motion) => ctx.terminal_mut().vi_motion(motion),
+ Action::ViMotion(motion) => {
+ if ctx.config().ui_config.mouse.hide_when_typing {
+ ctx.window_mut().set_mouse_visible(false);
+ }
+
+ ctx.terminal_mut().vi_motion(motion)
+ },
Action::ToggleFullscreen => ctx.window_mut().toggle_fullscreen(),
#[cfg(target_os = "macos")]
Action::ToggleSimpleFullscreen => ctx.window_mut().toggle_simple_fullscreen(),
@@ -714,6 +724,10 @@ impl<'a, T: EventListener, A: ActionContext<T>> Processor<'a, T, A> {
return;
}
+ if self.ctx.config().ui_config.mouse.hide_when_typing {
+ self.ctx.window_mut().set_mouse_visible(false);
+ }
+
self.ctx.scroll(Scroll::Bottom);
self.ctx.clear_selection();