input: clean up mouse scroll handling

* Allow scrolling on the normal (non-alt) screen, when application is
  grabbing the mouse (when user presses Shift).
* Use term_mouse_grabbed() instead of explicitly checking for
  MOUSE_NONE tracking.
* Remove mouse tracking check from cmd_scrollback_{up,down}. Caller is
  expected to have done the check.
* Don’t scroll down on mouse wheel tilt events.
This commit is contained in:
Daniel Eklöf 2021-10-25 19:39:46 +02:00
parent 3413901678
commit 0900d01ec9
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 21 additions and 14 deletions

View file

@ -18,9 +18,6 @@ cmd_scrollback_up(struct terminal *term, int rows)
if (urls_mode_is_active(term))
return;
if (term->mouse_tracking != MOUSE_NONE)
return;
rows = min(rows, term->rows);
xassert(term->grid->offset >= 0);
@ -98,9 +95,6 @@ cmd_scrollback_down(struct terminal *term, int rows)
if (urls_mode_is_active(term))
return;
if (term->mouse_tracking != MOUSE_NONE)
return;
if (term->grid->view == term->grid->offset)
return;