[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] ui: don't send any event if delta_y == 0
From: |
Sergio Lopez |
Subject: |
[Qemu-devel] [PATCH] ui: don't send any event if delta_y == 0 |
Date: |
Mon, 4 Feb 2019 13:20:43 +0100 |
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 <address@hidden>
---
ui/gtk.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/ui/gtk.c b/ui/gtk.c
index 77bd19025d..57af69b0c4 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;
--
2.20.1
- [Qemu-devel] [PATCH] ui: don't send any event if delta_y == 0,
Sergio Lopez <=