[gtk+/multitouch: 25/123] scrolledwindow: Only do kinetic scrolling on touch devices
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/multitouch: 25/123] scrolledwindow: Only do kinetic scrolling on touch devices
- Date: Mon, 16 Jan 2012 18:44:21 +0000 (UTC)
commit 4bfbcf476a15645702c72420898d523ff65171f1
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Nov 1 12:52:50 2011 +0100
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 | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index 95d1126..3a8de64 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -495,9 +495,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,
@@ -3041,11 +3042,18 @@ gtk_scrolled_window_button_press_event (GtkWidget *widget,
gint threshold;
GtkWidget *event_widget;
GdkEventButton *event;
- GdkDevice *device;
+ GdkDevice *device, *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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]