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



commit 000fa18ae443cb1c79e71544fec8d0fa3422a204
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 56b26b3..9b53e1a 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -9885,6 +9885,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]