Fix touchpads to not warp to bizarre places on initial touch.

This commit is contained in:
Adam Jackson 2013-10-07 17:04:27 -04:00
parent 29cb522c88
commit 88070da351
2 changed files with 44 additions and 1 deletions

View File

@ -0,0 +1,38 @@
diff -up clutter-1.16.0/clutter/evdev/clutter-device-manager-evdev.c.jx clutter-1.16.0/clutter/evdev/clutter-device-manager-evdev.c
--- clutter-1.16.0/clutter/evdev/clutter-device-manager-evdev.c.jx 2013-09-22 13:22:30.000000000 -0400
+++ clutter-1.16.0/clutter/evdev/clutter-device-manager-evdev.c 2013-10-07 16:48:28.232916813 -0400
@@ -535,11 +535,6 @@ dispatch_one_event (ClutterEventSource *
else if (e->code == BTN_TOOL_FINGER && e->value != AUTOREPEAT_VALUE)
{
source->touching = e->value;
- if (e->value)
- {
- source->last_x = source->cur_x;
- source->last_y = source->cur_y;
- }
}
else
{
@@ -580,6 +575,22 @@ dispatch_one_event (ClutterEventSource *
break;
case EV_ABS:
+ /* first touch is magic */
+ if (source->touching == 1)
+ {
+ switch (e->code)
+ {
+ case ABS_X:
+ source->last_x = source->cur_x = e->value;
+ break;
+ case ABS_Y:
+ source->last_y = source->cur_y = e->value;
+ source->touching = 2; /* note, assumes delivery order... */
+ break;
+ }
+ break;
+ }
+
switch (e->code)
{
case ABS_X:

View File

@ -6,13 +6,14 @@
Name: clutter
Version: 1.16.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Open Source software library for creating rich graphical user interfaces
Group: Development/Libraries
License: LGPLv2+
URL: http://www.clutter-project.org/
Source0: http://download.gnome.org/sources/clutter/1.16/clutter-%{version}.tar.xz
Patch0: clutter-1.16.0-fix-evdev-touchpad.patch
BuildRequires: glib2-devel mesa-libGL-devel pkgconfig pango-devel
BuildRequires: cairo-gobject-devel gdk-pixbuf2-devel atk-devel
@ -79,6 +80,7 @@ This package contains documentation for clutter.
%prep
%setup -q
%patch0 -p1 -b .touch
%build
(if ! test -x configure; then NOCONFIGURE=1 ./autogen.sh; CONFIGFLAGS=--enable-gtk-doc; fi;
@ -130,6 +132,9 @@ find %{buildroot} -name '*.la' -exec rm -f {} ';'
%{_datadir}/gtk-doc/html/cally
%changelog
* Mon Oct 07 2013 Adam Jackson <ajax@redhat.com> 1.16.0-2
- Fix touchpads to not warp to bizarre places on initial touch.
* Tue Sep 24 2013 Kalev Lember <kalevlember@gmail.com> - 1.16.0-1
- Update to 1.16.0