Skip to content

Commit

Permalink
shell: Use discrete scroll events
Browse files Browse the repository at this point in the history
This turns smooth scroll events from a touchpad to discrete scroll
events, making their speed what you'd expect.
  • Loading branch information
jadahl authored and Lyude committed Dec 17, 2022
1 parent 33cf0ee commit 0ceef22
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,8 @@ impl Shell {
state.nvim_viewport.add_controller(&focus_controller);

let scroll_controller = gtk::EventControllerScroll::new(
gtk::EventControllerScrollFlags::BOTH_AXES
gtk::EventControllerScrollFlags::BOTH_AXES |
gtk::EventControllerScrollFlags::DISCRETE
);
scroll_controller.connect_scroll(clone!(
state_ref, ui_state_ref => move |controller, dx, dy| {
Expand Down

0 comments on commit 0ceef22

Please sign in to comment.