[gtk+/smooth-scrolling: 6/16] gdk: Filter out either smooth or non-smooth event depending on the evmask
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/smooth-scrolling: 6/16] gdk: Filter out either smooth or non-smooth event depending on the evmask
- Date: Sat, 18 Feb 2012 17:09:47 +0000 (UTC)
commit 535e6c5c6e5293a44ea08849ab759c62dfd5ffb5
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 a46ccfb..55c9e37 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -9888,6 +9888,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]