[libchamplain] backport upstream fix for touch scrolling
Adam Williamson
adamwill at fedoraproject.org
Wed Apr 16 18:35:14 UTC 2014
commit d02687222583b9a7145751bf692ad7940946ffde
Author: Adam Williamson <awilliam at redhat.com>
Date: Wed Apr 16 11:34:56 2014 -0700
backport upstream fix for touch scrolling
...uch-support-to-the-kinetic-scrolling-call.patch | 61 ++++++++++++++++++++
libchamplain.spec | 10 +++-
2 files changed, 70 insertions(+), 1 deletions(-)
---
diff --git a/0001-Added-in-touch-support-to-the-kinetic-scrolling-call.patch b/0001-Added-in-touch-support-to-the-kinetic-scrolling-call.patch
new file mode 100644
index 0000000..fa935c2
--- /dev/null
+++ b/0001-Added-in-touch-support-to-the-kinetic-scrolling-call.patch
@@ -0,0 +1,61 @@
+From 75c8c5a68bb385357f5c0e9167846050d7259cc6 Mon Sep 17 00:00:00 2001
+From: Reyad Attiyat <reyad.attiyat at gmail.com>
+Date: Wed, 2 Apr 2014 17:39:34 -0500
+Subject: [PATCH] Added in touch support to the kinetic scrolling callbacks
+
+---
+ champlain/champlain-kinetic-scroll-view.c | 15 ++++++++++-----
+ 1 file changed, 10 insertions(+), 5 deletions(-)
+
+diff --git a/champlain/champlain-kinetic-scroll-view.c b/champlain/champlain-kinetic-scroll-view.c
+index b027f6a..20867ff 100644
+--- a/champlain/champlain-kinetic-scroll-view.c
++++ b/champlain/champlain-kinetic-scroll-view.c
+@@ -258,9 +258,10 @@ motion_event_cb (ClutterActor *stage,
+ ClutterActor *actor = CLUTTER_ACTOR (scroll);
+ gfloat x, y;
+
+- if (event->type != CLUTTER_MOTION || !(event->modifier_state & CLUTTER_BUTTON1_MASK))
++ if ((event->type != CLUTTER_MOTION || !(event->modifier_state & CLUTTER_BUTTON1_MASK)) &&
++ event->type != CLUTTER_TOUCH_UPDATE)
+ return FALSE;
+-
++
+ if (clutter_actor_transform_stage_point (actor,
+ event->x,
+ event->y,
+@@ -389,8 +390,10 @@ button_release_event_cb (ClutterActor *stage,
+ ClutterActor *actor = CLUTTER_ACTOR (scroll);
+ gboolean decelerating = FALSE;
+
++
+ if ((event->type != CLUTTER_MOTION || event->modifier_state & CLUTTER_BUTTON1_MASK) &&
+- (event->type != CLUTTER_BUTTON_RELEASE || event->button != 1))
++ (event->type != CLUTTER_BUTTON_RELEASE || event->button != 1) &&
++ event->type != CLUTTER_TOUCH_END)
+ return FALSE;
+
+ g_signal_handlers_disconnect_by_func (stage,
+@@ -586,8 +589,8 @@ button_press_event_cb (ClutterActor *actor,
+ ClutterButtonEvent *bevent = (ClutterButtonEvent *) event;
+ ClutterActor *stage = clutter_actor_get_stage (actor);
+
+- if ((event->type == CLUTTER_BUTTON_PRESS) &&
+- (bevent->button == 1) &&
++ if ((((event->type == CLUTTER_BUTTON_PRESS) && (bevent->button == 1)) ||
++ event->type == CLUTTER_TOUCH_BEGIN) &&
+ stage)
+ {
+ ChamplainKineticScrollViewMotion *motion;
+@@ -637,6 +640,8 @@ champlain_kinetic_scroll_view_init (ChamplainKineticScrollView *self)
+ clutter_actor_set_reactive (CLUTTER_ACTOR (self), TRUE);
+ g_signal_connect (self, "button-press-event",
+ G_CALLBACK (button_press_event_cb), self);
++ g_signal_connect (self, "touch-event",
++ G_CALLBACK (button_press_event_cb), self);
+ }
+
+
+--
+1.9.0
+
diff --git a/libchamplain.spec b/libchamplain.spec
index bbbb6c6..1e986fc 100644
--- a/libchamplain.spec
+++ b/libchamplain.spec
@@ -3,12 +3,16 @@
Summary: Map view for Clutter
Name: libchamplain
Version: 0.12.7
-Release: 2%{?dist}
+Release: 3%{?dist}
License: LGPLv2+
Group: System Environment/Libraries
URL: http://projects.gnome.org/libchamplain/
Source0: http://download.gnome.org/sources/libchamplain/0.12/%{name}-%{version}.tar.xz
+# Backport of upstream https://git.gnome.org/browse/libchamplain/commit/?id=75c8c5a68bb385357f5c0e9167846050d7259cc6
+# Should make drag scrolling work with touch input
+Patch0: 0001-Added-in-touch-support-to-the-kinetic-scrolling-call.patch
+
Requires: gobject-introspection
BuildRequires: chrpath
@@ -74,6 +78,7 @@ This package contains demos for development using %{name}.
%prep
%setup -q
+%patch0 -p1 -b .touch_scroll
%build
%configure --disable-debug --disable-silent-rules --disable-static \
@@ -143,6 +148,9 @@ chrpath --delete $RPM_BUILD_ROOT%{_libdir}/%{name}-gtk-*.so.*
%doc demos/*.osm
%changelog
+* Wed Apr 16 2014 Adam Williamson <awilliam at redhat.com> - 0.12.7-3
+- backport upstream fix for touch scrolling
+
* Thu Feb 20 2014 Kalev Lember <kalevlember at gmail.com> - 0.12.7-2
- Rebuilt for cogl soname bump
More information about the scm-commits
mailing list