summaryrefslogtreecommitdiff
path: root/gdk/gdkevents.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2015-10-21 10:14:40 +1000
committerCarlos Garnacho <carlosg@gnome.org>2016-01-18 21:36:23 +0100
commit48aa1bb08f89a1f3f8f290da771f183cdd5061d8 (patch)
tree10cfcc41321a1add28e88503092efa764c358f5b /gdk/gdkevents.c
parent3fca36169a0fd5f19b1b2099547060214f40b904 (diff)
downloadgtk+-48aa1bb08f89a1f3f8f290da771f183cdd5061d8.tar.gz
wayland: add gdk_event_is_scroll_stop_event()
And use it to handle kinetic scrolling in the GtkScrolledWindow. However, dropping the delta check causes the X11-based kinetic scroll to break since we don't have the stop event here. Correct handling of xf86-input-libinput-based scroll events is still being discussed. https://bugzilla.gnome.org/show_bug.cgi?id=756729
Diffstat (limited to 'gdk/gdkevents.c')
-rw-r--r--gdk/gdkevents.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index 9ed43176aa..83f8ab11f2 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -562,6 +562,7 @@ gdk_event_new (GdkEventType type)
new_event->scroll.y_root = 0.;
new_event->scroll.delta_x = 0.;
new_event->scroll.delta_y = 0.;
+ new_event->scroll.is_stop = FALSE;
break;
case GDK_ENTER_NOTIFY:
case GDK_LEAVE_NOTIFY:
@@ -1419,6 +1420,28 @@ gdk_event_get_scroll_deltas (const GdkEvent *event,
}
/**
+ * gdk_event_is_scroll_stop_event
+ * @event: a #GdkEvent
+ *
+ * Check whether a scroll event is a stop scroll event. Scroll sequences
+ * with smooth scroll information may provide a stop scroll event once the
+ * interaction with the device finishes, e.g. by lifting a finger. This
+ * stop scroll event is the signal that a widget may trigger kinetic
+ * scrolling based on the current velocity.
+ *
+ * Stop scroll events always have a a delta of 0/0.
+ *
+ * Returns: %TRUE if the event is a scroll stop event
+ *
+ * Since: 3.20
+ */
+gboolean
+gdk_event_is_scroll_stop_event (const GdkEvent *event)
+{
+ return event->scroll.is_stop;
+}
+
+/**
* gdk_event_get_axis:
* @event: a #GdkEvent
* @axis_use: the axis use to look for