Skip to content

Commit

Permalink
fix: Hide cursor regardless of key binding
Browse files Browse the repository at this point in the history
  • Loading branch information
yzy-1 committed Oct 3, 2024
1 parent c55c1cd commit c91373c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/input/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ impl State {
}
}

self.hide_cursor_if_needed();

let Some(Some(bind)) = self.niri.seat.get_keyboard().unwrap().input(
self,
event.key_code(),
Expand Down Expand Up @@ -350,7 +352,6 @@ impl State {
self.handle_bind(bind.clone());

self.start_key_repeat(bind);
self.hide_cursor_if_needed();
}

fn start_key_repeat(&mut self, bind: Bind) {
Expand All @@ -364,15 +365,16 @@ impl State {
}

let config = self.niri.config.borrow();
let repeat_rate = config.input.keyboard.repeat_rate;
let config = &config.input.keyboard;

let repeat_rate = config.repeat_rate;
if repeat_rate == 0 {
return;
}
let repeat_duration = Duration::from_secs_f64(1. / f64::from(repeat_rate));

let repeat_timer = Timer::from_duration(Duration::from_millis(u64::from(
config.input.keyboard.repeat_delay,
)));
let repeat_timer =
Timer::from_duration(Duration::from_millis(u64::from(config.repeat_delay)));

let token = self
.niri
Expand Down

0 comments on commit c91373c

Please sign in to comment.