[gtk+/smooth-scrolling-for-3.4: 6/16] gdk: Filter out either smooth or non-smooth event depending on the evmask



commit 7d8962da7c17454007c4bb4927baf91cdb4d6997
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Jan 24 00:09:40 2012 +0100

    gdk: Filter out either smooth or non-smooth event depending on the evmask
    
    If a device provides both smooth and non-smooth events, the latter will be
    flagged with _gdk_event_set_pointer_emulated() so the client side window
    receives one or the other. If a device is only able to deliver non-smooth
    events, those will be sent, so both direction/deltas may need to be handled.

 gdk/gdkwindow.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 1d50637..16651d6 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -9653,6 +9653,13 @@ proxy_button_event (GdkEvent *source_event,
                                        state, time_, source_event,
                                        serial, FALSE);
     }
+  else if (type == GDK_SCROLL &&
+           (((evmask & GDK_SMOOTH_SCROLL_MASK) == 0 &&
+             source_event->scroll.direction == GDK_SCROLL_SMOOTH) ||
+            ((evmask & GDK_SMOOTH_SCROLL_MASK) != 0 &&
+             source_event->scroll.direction != GDK_SCROLL_SMOOTH &&
+             _gdk_event_get_pointer_emulated (source_event))))
+    return FALSE;
 
   event = _gdk_make_event (event_win, type, source_event, FALSE);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]