[gtk+/multitouch: 25/27] gtk, scrolledwindow: Let GDK_SOURCE_MULTITOUCH devices do kinetic scrolling
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/multitouch: 25/27] gtk, scrolledwindow: Let GDK_SOURCE_MULTITOUCH devices do kinetic scrolling
- Date: Mon, 5 Dec 2011 01:18:13 +0000 (UTC)
commit 04cda252aad73f974d858c5fa41dbea57b2db9e2
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Nov 23 21:06:39 2011 +0100
gtk,scrolledwindow: Let GDK_SOURCE_MULTITOUCH devices do kinetic scrolling
gtk/gtkscrolledwindow.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index 824407f..bb701ae 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -484,8 +484,9 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
*
* The kinetic scrolling behavior flags. Kinetic scrolling
* only applies to devices with source %GDK_SOURCE_TOUCH
+ * or %GDK_SOURCE_MULTITOUCH.
*
- * Since: 3.4
+ * Since: 3.2
*/
g_object_class_install_property (gobject_class,
PROP_KINETIC_SCROLLING,
@@ -2613,13 +2614,15 @@ gtk_scrolled_window_captured_button_press (GtkWidget *widget,
GdkInputSource source;
guint timeout;
- if (_event->type != GDK_BUTTON_PRESS)
+ if (_event->type != GDK_BUTTON_PRESS &&
+ _event->type != GDK_TOUCH_PRESS)
return GTK_CAPTURED_EVENT_NONE;
source_device = gdk_event_get_source_device (_event);
source = gdk_device_get_source (source_device);
- if (source != GDK_SOURCE_TOUCH)
+ if (source != GDK_SOURCE_TOUCH &&
+ source != GDK_SOURCE_MULTITOUCH)
return GTK_CAPTURED_EVENT_NONE;
event = (GdkEventButton *)_event;
@@ -2711,13 +2714,16 @@ gtk_scrolled_window_captured_event (GtkWidget *widget,
switch (event->type)
{
case GDK_BUTTON_PRESS:
+ case GDK_TOUCH_PRESS:
flags = gtk_scrolled_window_captured_button_press (widget, event);
break;
case GDK_BUTTON_RELEASE:
+ case GDK_TOUCH_RELEASE:
if (priv->drag_device)
flags = gtk_scrolled_window_captured_button_release (widget, event);
break;
case GDK_MOTION_NOTIFY:
+ case GDK_TOUCH_MOTION:
if (priv->drag_device)
flags = gtk_scrolled_window_captured_motion_notify (widget, event);
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]