qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] ui: don't send any event if delta_y == 0
@ 2019-02-04 12:20 Sergio Lopez
  2019-02-04 13:23 ` no-reply
  2019-02-05  8:53 ` Gerd Hoffmann
  0 siblings, 2 replies; 3+ messages in thread
From: Sergio Lopez @ 2019-02-04 12:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: kraxel, Sergio Lopez

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>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-02-05  8:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-04 12:20 [Qemu-devel] [PATCH] ui: don't send any event if delta_y == 0 Sergio Lopez
2019-02-04 13:23 ` no-reply
2019-02-05  8:53 ` Gerd Hoffmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).