diff options
| author | Sergio Lopez <slp@redhat.com> | 2019-02-04 13:20:43 +0100 |
|---|---|---|
| committer | Gerd Hoffmann <kraxel@redhat.com> | 2019-02-05 09:52:36 +0100 |
| commit | a0fbb9a8bc600063540443258c66c31f31048008 (patch) | |
| tree | 676a89415bf30d408d91e615a70947a1c5c3ff23 | |
| parent | 09bd7ba9f5f7bd1c0cf62ba89731ae3cc6d1c72e (diff) | |
| download | focaccia-qemu-a0fbb9a8bc600063540443258c66c31f31048008.tar.gz focaccia-qemu-a0fbb9a8bc600063540443258c66c31f31048008.zip | |
ui: don't send any event if delta_y == 0
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>
| -rw-r--r-- | ui/gtk.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/gtk.c b/ui/gtk.c index 87c0e33d2a..5a584353bd 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -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; |