rpms/xorg-x11-drv-synaptics/F-11 synaptics-1.1.0-edges.patch, NONE, 1.1 xorg-x11-drv-synaptics.spec, 1.28, 1.29
Peter Hutterer
whot at fedoraproject.org
Mon May 4 23:42:36 UTC 2009
Author: whot
Update of /cvs/pkgs/rpms/xorg-x11-drv-synaptics/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv31631
Modified Files:
xorg-x11-drv-synaptics.spec
Added Files:
synaptics-1.1.0-edges.patch
Log Message:
* Tue May 05 2009 Peter Hutterer <peter.hutterer at redhat.com> 1.1.0-4
- synaptics-1.1.0-edges.patch: Set default edge sizes depending on model
(#494766).
synaptics-1.1.0-edges.patch:
--- NEW FILE synaptics-1.1.0-edges.patch ---
>From 52e72fb741f469d82c6c859e17e055d8cb77bcfa Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer at who-t.net>
Date: Fri, 1 May 2009 13:37:44 +1000
Subject: [PATCH] Add TouchpadModel specifier and scale the edges accordingly. (#21214)
ALPS models need different edge settings than synaptics pads to make the edges
work propertly. So try to auto-detect the model (eventcomm anyway) and set the
edges accordingly.
New edge defaults are:
synaptics: 7% of the total width
alps: 15% of the total width
unknown: 4% of the total width (see Synaptics UI guide)
X.Org Bug 21214 <http://bugs.freedesktop.org/show_bug.cgi?id=21214>
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
src/eventcomm.c | 19 +++++++++++++++++++
src/synaptics.c | 20 +++++++++++++++++---
src/synapticsstr.h | 8 ++++++++
3 files changed, 44 insertions(+), 3 deletions(-)
diff --git a/src/eventcomm.c b/src/eventcomm.c
index 3e4c074..3b03695 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -115,6 +115,24 @@ event_query_is_touchpad(int fd)
return TRUE;
}
+static void
+event_query_info(LocalDevicePtr local)
+{
+ SynapticsPrivate *priv = (SynapticsPrivate *)local->private;
+ short id[4];
+ int rc;
+
+ SYSCALL(rc = ioctl(local->fd, EVIOCGID, id));
+ if (rc < 0)
+ return;
+
+ if (id[ID_VENDOR] == 0x2 && id[ID_PRODUCT] == 0x7)
+ priv->model = MODEL_SYNAPTICS;
+ else if (id[ID_VENDOR] == 0x2 && id[ID_PRODUCT] == 0x8)
+ priv->model = MODEL_ALPS;
+
+}
+
/* Query device for axis ranges */
static void
event_query_axis_ranges(LocalDevicePtr local)
@@ -360,6 +378,7 @@ EventReadDevDimensions(LocalDevicePtr local)
{
if (event_query_is_touchpad(local->fd))
event_query_axis_ranges(local);
+ event_query_info(local);
}
static Bool
diff --git a/src/synaptics.c b/src/synaptics.c
index 2383c38..ee1239a 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -318,7 +318,10 @@ static void set_default_parameters(LocalDevicePtr local)
/* The synaptics specs specify typical edge widths of 4% on x, and 5.4% on
* y (page 7) [Synaptics TouchPad Interfacing Guide, 510-000080 - A
* Second Edition, http://www.synaptics.com/support/dev_support.cfm, 8 Sep
- * 2008]
+ * 2008]. We use 7% for both instead for synaptics devices, and 15% for
+ * ALPS models.
+ * http://bugs.freedesktop.org/show_bug.cgi?id=21214
+ *
* If the range was autodetected, apply these edge widths to all four
* sides.
*/
@@ -330,8 +333,19 @@ static void set_default_parameters(LocalDevicePtr local)
width = abs(priv->maxx - priv->minx);
height = abs(priv->maxy - priv->miny);
diag = sqrt(width * width + height * height);
- ewidth = width * .04;
- eheight = height * .055;
+ if (priv->model == MODEL_SYNAPTICS)
+ {
+ ewidth = width * .07;
+ eheight = height * .07;
+ } else if (priv->model == MODEL_ALPS)
+ {
+ ewidth = width * .15;
+ eheight = height * .15;
+ } else
+ {
+ ewidth = width * .04;
+ eheight = height * .04;
+ }
l = priv->minx + ewidth;
r = priv->maxx - ewidth;
diff --git a/src/synapticsstr.h b/src/synapticsstr.h
index 688167c..f518c11 100644
--- a/src/synapticsstr.h
+++ b/src/synapticsstr.h
@@ -79,6 +79,12 @@ enum TapButtonState {
TBS_BUTTON_DOWN_UP /* Send button down event + set up state */
};
+enum TouchpadModel {
+ MODEL_UNKNOWN = 0,
+ MODEL_SYNAPTICS,
+ MODEL_ALPS
+};
+
typedef struct _SynapticsPrivateRec
{
SynapticsSHM synpara_default; /* Default parameter settings, read from
@@ -146,6 +152,8 @@ typedef struct _SynapticsPrivateRec
Bool has_double; /* double click detected for this device */
Bool has_triple; /* triple click detected for this device */
Bool has_pressure; /* device reports pressure */
+
+ enum TouchpadModel model; /* The detected model */
} SynapticsPrivate;
#endif /* _SYNAPTICSSTR_H_ */
--
1.6.3.rc1.1.g81c43.dirty
Index: xorg-x11-drv-synaptics.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-synaptics/F-11/xorg-x11-drv-synaptics.spec,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -p -r1.28 -r1.29
--- xorg-x11-drv-synaptics.spec 15 Apr 2009 21:47:07 -0000 1.28
+++ xorg-x11-drv-synaptics.spec 4 May 2009 23:42:04 -0000 1.29
@@ -7,7 +7,7 @@
Name: xorg-x11-drv-synaptics
Summary: Xorg X11 Synaptics touchpad input driver
Version: 1.1.0
-Release: 3%{?dist}
+Release: 4%{?dist}
URL: http://www.x.org
License: MIT
Group: User Interface/X Hardware Support
@@ -20,6 +20,7 @@ Source2: make-git-snapshot.sh
Patch1: synaptics-1.1.0-synclient-64.patch
Patch2: synaptics-1.1.0-allocate-timer-early.patch
+Patch3: synaptics-1.1.0-edges.patch
ExcludeArch: s390 s390x
@@ -79,6 +80,7 @@ Features:
%patch1 -p1
%patch2 -p1
+%patch3 -p1
%build
autoreconf -v --install --force || exit 1
@@ -127,6 +129,10 @@ Development files for the Synaptics Touc
%changelog
+* Tue May 05 2009 Peter Hutterer <peter.hutterer at redhat.com> 1.1.0-4
+- synaptics-1.1.0-edges.patch: Set default edge sizes depending on model
+ (#494766).
+
* Wed Apr 15 2009 Adam Jackson <ajax at redhat.com> 1.1.0-3
- synaptics-1.1.0-allocate-timer-early.patch: Allocate the timer early so
we don't try to malloc it within a sigio handler.
More information about the fedora-extras-commits
mailing list