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



commit b177bd92aab35c831ee55d08390af7a6bcad0109
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 597b8cb..e1a4915 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -9696,6 +9696,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]