[gtk/wip/exalm/scroll-gesture: 363/369] gesturedrag: Allow scroll events




commit 75f6baa853872460efd250eba24c38731c901ef9
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Fri Sep 17 18:40:40 2021 +0500

    gesturedrag: Allow scroll events

 gtk/gtkgesturedrag.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkgesturedrag.c b/gtk/gtkgesturedrag.c
index 331189b433..c5f82a2196 100644
--- a/gtk/gtkgesturedrag.c
+++ b/gtk/gtkgesturedrag.c
@@ -62,8 +62,10 @@ static GtkFilterEventStatus
 gtk_gesture_drag_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;
@@ -77,6 +79,9 @@ gtk_gesture_drag_filter_event (GtkEventController *controller,
         return GTK_EVENT_SKIP;
     }
 
+  if (event_type == GDK_SCROLL)
+    return GTK_EVENT_HANDLE;
+
   return GTK_EVENT_CONTROLLER_CLASS (gtk_gesture_drag_parent_class)->filter_event (controller, event);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]