From 2443c7d705583650692c6f28e5f1857da8134c11 Mon Sep 17 00:00:00 2001 From: daa Date: Sat, 15 Apr 2017 20:07:09 +0300 Subject: [PATCH] Fix mouse scroll bug --- src/shell.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/shell.rs b/src/shell.rs index 1e626a5..dc02915 100644 --- a/src/shell.rs +++ b/src/shell.rs @@ -302,7 +302,7 @@ fn gtk_focus_out(state: &mut State) -> Inhibit { } fn gtk_scroll_event(state: &mut State, ui_state: &mut UiState, ev: &EventScroll) -> Inhibit { - if state.mouse_enabled { + if !state.mouse_enabled { return Inhibit(false); } @@ -346,6 +346,8 @@ fn gtk_button_press(shell: &mut State, ui_state: &mut UiState, ev: &EventButton) } if shell.mouse_enabled { + ui_state.mouse_pressed = true; + mouse_input(shell, ui_state, "LeftMouse", @@ -362,7 +364,6 @@ fn mouse_input(shell: &mut State, position: (f64, f64)) { if let Some(line_height) = shell.line_height { if let Some(char_width) = shell.char_width { - ui_state.mouse_pressed = true; let nvim = shell.nvim(); let (x, y) = position;