[gtk/wip/exalm/scroll-gesture: 365/369] gestureswipe: Allow scroll events




commit 9ddf5892f7e65d6d5d889f1dcd6bd98e772eae2e
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]