From 7b7abdfc71328200021bfcf0664490b1ea0c846b Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Tue, 1 Nov 2011 12:52:50 +0100 Subject: [PATCH] scrolledwindow: Only do kinetic scrolling on touch devices This is sort of meaningless on pointer devices, besides it implies a different input event handling on child widgets that's unnecessary there. --- gtk/gtkscrolledwindow.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c index 56b1040cf1..11dfb7cb21 100644 --- a/gtk/gtkscrolledwindow.c +++ b/gtk/gtkscrolledwindow.c @@ -469,9 +469,10 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class) /** * GtkScrolledWindow:kinetic-scrolling: * - * Whether kinetic scrolling mode is enabled. + * Whether kinetic scrolling mode is enabled, + * only applies to devices with source %GDK_SOURCE_TOUCH * - * Since: 3.2 + * Since: 3.4 */ g_object_class_install_property (gobject_class, PROP_KINETIC_SCROLLING, @@ -2879,10 +2880,18 @@ gtk_scrolled_window_button_press_event (GtkWidget *widget, gint threshold; GtkWidget *event_widget; GdkEventButton *event; + GdkDevice *source_device; + GdkInputSource source; if (_event->type != GDK_BUTTON_PRESS) return FALSE; + source_device = gdk_event_get_source_device (_event); + source = gdk_device_get_source (source_device); + + if (source != GDK_SOURCE_TOUCH) + return FALSE; + event = (GdkEventButton *)_event; if (event->button != 1)