Skip to content

Commit

Permalink
ui: don't send any event if delta_y == 0
Browse files Browse the repository at this point in the history
When the user raises their fingers from the touchpad, we may receive a
GDK_SMOOTH_SCROLL event with delta_y == 0. Avoid generating a WHEEL_UP
event in this situation.

Signed-off-by: Sergio Lopez <slp@redhat.com>
Message-id: 20190204122043.43007-1-slp@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
  • Loading branch information
slp authored and kraxel committed Feb 5, 2019
1 parent 09bd7ba commit a0fbb9a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ui/gtk.c
Expand Up @@ -1004,7 +1004,9 @@ static gboolean gd_scroll_event(GtkWidget *widget, GdkEventScroll *scroll,
&delta_x, &delta_y)) {
return TRUE;
}
if (delta_y > 0) {
if (delta_y == 0) {
return TRUE;
} else if (delta_y > 0) {
btn = INPUT_BUTTON_WHEEL_DOWN;
} else {
btn = INPUT_BUTTON_WHEEL_UP;
Expand Down

0 comments on commit a0fbb9a

Please sign in to comment.