[gtk/wip/exalm/scroll-gesture: 362/369] gesturesingle: Pass through scroll events




commit 63b59e07177beb5e7a0a4a5af4c44ed6954f9ddc
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Fri Sep 17 18:37:43 2021 +0500

    gesturesingle: Pass through scroll events
    
    We want to have them in GtkGestureDrag/Pan/Swipe.
    
    Ignore motion events when no button is pressed - otherwise moving the
    widget under the poitner in response to scrolling or a touchpad swipe would
    interfere with them.

 gtk/gtkgesturesingle.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/gtk/gtkgesturesingle.c b/gtk/gtkgesturesingle.c
index 8a4b7a14c5..e7ad623a0e 100644
--- a/gtk/gtkgesturesingle.c
+++ b/gtk/gtkgesturesingle.c
@@ -196,10 +196,14 @@ gtk_gesture_single_handle_event (GtkEventController *controller,
             }
         }
 
+      if (button == 0)
+        return FALSE;
+
       break;
     case GDK_TOUCH_CANCEL:
     case GDK_GRAB_BROKEN:
     case GDK_TOUCHPAD_SWIPE:
+    case GDK_SCROLL:
       return GTK_EVENT_CONTROLLER_CLASS (gtk_gesture_single_parent_class)->handle_event (controller, event, 
x, y);
       break;
     default:


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