[gtk/wip/exalm/scroll-gesture: 6/11] gestureswipe: Allow scroll events
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/exalm/scroll-gesture: 6/11] gestureswipe: Allow scroll events
- Date: Tue, 28 Sep 2021 19:33:51 +0000 (UTC)
commit c8a03e974f9e57e1d2235e44679714c37823649d
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Fri Sep 17 18:40:32 2021 +0500
gestureswipe: Allow scroll events
gtk/gtkgestureswipe.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkgestureswipe.c b/gtk/gtkgestureswipe.c
index 991e7bf860..6ac7901331 100644
--- a/gtk/gtkgestureswipe.c
+++ b/gtk/gtkgestureswipe.c
@@ -85,8 +85,10 @@ static GtkFilterEventStatus
gtk_gesture_swipe_filter_event (GtkEventController *controller,
GdkEvent *event)
{
+ GdkEventType event_type = gdk_event_get_event_type (event);
+
/* Let touchpad swipe events go through, only if they match n-points */
- if (gdk_event_get_event_type (event) == GDK_TOUCHPAD_SWIPE)
+ if (event_type == GDK_TOUCHPAD_SWIPE)
{
guint n_points;
guint n_fingers;
@@ -101,6 +103,9 @@ gtk_gesture_swipe_filter_event (GtkEventController *controller,
return GTK_EVENT_SKIP;
}
+ if (event_type == GDK_SCROLL)
+ return GTK_EVENT_HANDLE;
+
return GTK_EVENT_CONTROLLER_CLASS (gtk_gesture_swipe_parent_class)->filter_event (controller, event);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]