rpms/xorg-x11-drv-synaptics/devel synaptics-1.2.2-clickfinger-defaults.patch, NONE, 1.1 synaptics-1.2.2-clickpad-support.patch, NONE, 1.1 xorg-x11-drv-synaptics.spec, 1.47, 1.48

Peter Hutterer whot at fedoraproject.org
Thu May 13 01:11:19 UTC 2010


Author: whot

Update of /cvs/pkgs/rpms/xorg-x11-drv-synaptics/devel
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv28033

Modified Files:
	xorg-x11-drv-synaptics.spec 
Added Files:
	synaptics-1.2.2-clickfinger-defaults.patch 
	synaptics-1.2.2-clickpad-support.patch 
Log Message:
* Thu May 13 2010 Peter Hutterer <peter.hutterer at redhat.com> 1.2.2-5
- Change ClickFinger defaults to 0 if there's more than one.
- Add ClickPad support, this requires a kernel patch as well (#590835)
- pop the udev rule into /lib/udev/rules.d instead of $sysconfigdir


synaptics-1.2.2-clickfinger-defaults.patch:
 synaptics.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

--- NEW FILE synaptics-1.2.2-clickfinger-defaults.patch ---
>From 776ec0ed42616769ed834b5822df3b2b0d5c0e85 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer at who-t.net>
Date: Thu, 29 Apr 2010 15:03:55 +1000
Subject: [PATCH] Disable ClickFinger for touchpads with more than one physical button (#26079)

If a touchpad has more than just one (or no) button, don't enable any
ClickFinger settings other than button 1.

The old default of enabling those clickfingers can be confusing on devices
that have left and right buttons but no middle. In that case, leaving three
fingers on the touchpad and clicking will result in a button 2 press
(usually paste). But leaving one or two fingers on the touchpad while
clicking will simply send button 1 events.

This can appear like spurious button 2 events to the user.

X.Org Bug 26079 <http://bugs.freedesktop.org/show_bug.cgi?id=26079>

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/synaptics.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/synaptics.c b/src/synaptics.c
index 091dbe1..2f432ce 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -437,11 +437,11 @@ static void set_default_parameters(LocalDevicePtr local)
     tapButton2 = priv->has_left ? 0 : 3;
     tapButton3 = priv->has_left ? 0 : 2;
 
-    /* Enable multifinger-click if we don't have right/middle button,
+    /* Enable multifinger-click if only have one physical button,
        otherwise clickFinger is always button 1. */
     clickFinger1 = 1;
-    clickFinger2 = priv->has_right ? 1 : 3;
-    clickFinger3 = priv->has_middle ? 1 : 2;
+    clickFinger2 = (priv->has_right || priv->has_middle) ? 1 : 3;
+    clickFinger3 = (priv->has_right || priv->has_middle) ? 1 : 2;
 
     /* Enable vert edge scroll if we can't detect doubletap */
     vertEdgeScroll = priv->has_double ? FALSE : TRUE;
-- 
1.7.0.1


synaptics-1.2.2-clickpad-support.patch:
 eventcomm.c    |    6 ++++
 synaptics.c    |   72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 synapticsstr.h |    3 +-
 3 files changed, 79 insertions(+), 2 deletions(-)

--- NEW FILE synaptics-1.2.2-clickpad-support.patch ---
>From 7d4268ed33ecfe5b377ae2651ff07f4a8013223d Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai at suse.de>
Date: Fri, 23 Apr 2010 17:39:04 +0200
Subject: [PATCH] Add Clickpad support

This patch adds the support for Synaptics Clickpad devices.
It requires the change in Linux kernel synaptics input driver, found in
	https://patchwork.kernel.org/patch/92435/
The kernel patch is already included in linux-input GIT tree, which
will hit Linus tree sooner or later.

When the kernel driver sets only the left-button bit evbit and no
multi-finger is possible, Clickpad mode is activated.  In this mode,
the bottom touch area is used as button emulations.  Clicking at the
bottom-left, bottom-center and bottom-right zone corresponds to a left,
center and right click.

Signed-off-by: Takashi Iwai <tiwai at suse.de>
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/eventcomm.c    |    6 ++++
 src/synaptics.c    |   72 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 src/synapticsstr.h |    2 +
 3 files changed, 79 insertions(+), 1 deletions(-)

diff --git a/src/eventcomm.c b/src/eventcomm.c
index d00d810..6b44778 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -252,6 +252,12 @@ event_query_axis_ranges(LocalDevicePtr local)
 	if ((priv->has_triple = (TEST_BIT(BTN_TOOL_TRIPLETAP, keybits) != 0)))
 	   strcat(buf, " triple");
 	xf86Msg(X_INFO, "%s: buttons:%s\n", local->name, buf);
+
+	/* clickpad device reports only the single left button mask */
+	if (priv->has_left && !priv->has_right && !priv->has_middle && !priv->has_double) {
+	    priv->is_clickpad = TRUE;
+	    xf86Msg(X_INFO, "%s: is Clickpad device\n", local->name);
+	}
     }
 }
 
diff --git a/src/synaptics.c b/src/synaptics.c
index 091dbe1..554f7a3 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -457,6 +457,18 @@ static void set_default_parameters(LocalDevicePtr local)
         vertResolution = priv->resy;
     }
 
+    /* Clickpad mode -- bottom area is used as buttons */
+    if (priv->is_clickpad) {
+	int button_bottom;
+	/* Clickpad devices usually the button area at the bottom, and
+	 * its size seems ca. 20% of the touchpad height no matter how
+	 * large the pad is.
+	 */
+	button_bottom = priv->maxy - (abs(priv->maxy - priv->miny) * 20) / 100;
+	if (button_bottom < b && button_bottom >= t)
+	    b = button_bottom;
+    }
+
     /* set the parameters */
     pars->left_edge = xf86SetIntOption(opts, "LeftEdge", l);
     pars->right_edge = xf86SetIntOption(opts, "RightEdge", r);
@@ -2052,6 +2064,59 @@ HandleClickWithFingers(SynapticsParameters *para, struct SynapticsHwState *hw)
     }
 }
 
+/* clickpad event handling */
+static void
+HandleClickpad(LocalDevicePtr local, struct SynapticsHwState *hw, edge_type edge)
+{
+    SynapticsPrivate *priv = (SynapticsPrivate *) (local->private);
+    SynapticsParameters *para = &priv->synpara;
+
+    if (edge & BOTTOM_EDGE) {
+	/* button area */
+	int width = priv->maxx - priv->minx;
+	int left_button_x, right_button_x;
+
+	/* left and right clickpad button ranges;
+	 * the gap between them is interpreted as a middle-button click
+	 */
+	left_button_x = width * 2 / 5 + priv->minx;
+	right_button_x = width * 3 / 5 + priv->minx;
+
+	/* clickpad reports only one button, and we need
+	 * to fake left/right buttons depending on the touch position
+	 */
+	if (hw->left) { /* clicked? */
+	    hw->left = 0;
+	    if (hw->x < left_button_x)
+		hw->left = 1;
+	    else if (hw->x > right_button_x)
+		hw->right = 1;
+	    else
+		hw->middle = 1;
+	}
+
+	/* Don't move pointer position in the button area during clicked,
+	 * except for horiz/vert scrolling is enabled.
+	 *
+	 * The synaptics driver tends to be pretty sensitive.  This hack
+	 * is to avoid that the pointer moves slightly and misses the
+	 * poistion you aimed to click.
+	 *
+	 * Also, when the pointer movement is reported, the dragging
+	 * (with a sort of multi-touching) doesn't work well, too.
+	 */
+	if (hw->left || !(para->scroll_edge_horiz ||
+			  ((edge & RIGHT_EDGE) && para->scroll_edge_vert)))
+	    hw->z = 0; /* don't move pointer */
+
+    } else if (hw->left) {
+	/* dragging */
+	hw->left = priv->prev_hw.left;
+	hw->right = priv->prev_hw.right;
+	hw->middle = priv->prev_hw.middle;
+    }
+    priv->prev_hw = *hw;
+}
 
 /*
  * React on changes in the hardware state. This function is called every time
@@ -2102,6 +2167,12 @@ HandleState(LocalDevicePtr local, struct SynapticsHwState *hw)
     if (para->touchpad_off == 1)
 	return delay;
 
+    edge = edge_detection(priv, hw->x, hw->y);
+
+    /* Clickpad handling for button area */
+    if (priv->is_clickpad)
+	HandleClickpad(local, hw, edge);
+
     /* Treat the first two multi buttons as up/down for now. */
     hw->up |= hw->multi[0];
     hw->down |= hw->multi[1];
@@ -2152,7 +2223,6 @@ HandleState(LocalDevicePtr local, struct SynapticsHwState *hw)
 	hw->multi[2] = hw->multi[3] = FALSE;
     }
 
-    edge = edge_detection(priv, hw->x, hw->y);
     inside_active_area = is_inside_active_area(priv, hw->x, hw->y);
 
     finger = SynapticsDetectFinger(priv, hw);
diff --git a/src/synapticsstr.h b/src/synapticsstr.h
index bd19c79..05e43d3 100644
--- a/src/synapticsstr.h
+++ b/src/synapticsstr.h
@@ -232,6 +232,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 */
+    Bool is_clickpad;			/* is Clickpad device (one-button) */
+    struct SynapticsHwState prev_hw;	/* previous h/w state (for clickpad) */
 
     enum TouchpadModel model;          /* The detected model */
 } SynapticsPrivate;
-- 
1.7.0.1



Index: xorg-x11-drv-synaptics.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-synaptics/devel/xorg-x11-drv-synaptics.spec,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -p -r1.47 -r1.48
--- xorg-x11-drv-synaptics.spec	10 May 2010 04:41:10 -0000	1.47
+++ xorg-x11-drv-synaptics.spec	13 May 2010 01:11:19 -0000	1.48
@@ -7,7 +7,7 @@
 Name:           xorg-x11-drv-synaptics
 Summary:        Xorg X11 Synaptics touchpad input driver
 Version:        1.2.2
-Release:        4%{?dist}
+Release:        5%{?dist}
 URL:            http://www.x.org
 License:        MIT
 Group:          User Interface/X Hardware Support
@@ -19,6 +19,9 @@ Source1:        50-synaptics.conf
 Source2:        make-git-snapshot.sh
 Source3:        70-touchpad-quirks.rules
 
+Patch01:        synaptics-1.2.2-clickfinger-defaults.patch
+Patch02:        synaptics-1.2.2-clickpad-support.patch
+
 ExcludeArch:    s390 s390x
 
 BuildRequires:  libtool pkgconfig
@@ -75,6 +78,9 @@ Features:
 %setup -q -n %{tarball}-%{version}
 #%setup -q -n %{tarball}-%{gitdate}
 
+%patch01 -p1
+%patch02 -p1
+
 %build
 autoreconf -v --install --force || exit 1
 %configure --disable-static
@@ -92,8 +98,8 @@ find $RPM_BUILD_ROOT -regex ".*\.la$" | 
 install -d $RPM_BUILD_ROOT%{_datadir}/X11/xorg.conf.d
 install -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/X11/xorg.conf.d/50-synaptics.conf
 
-install -d $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d/
-install -m 0644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d/70-touchpad-quirks.conf
+install -d $RPM_BUILD_ROOT/lib/udev/rules.d/
+install -m 0644 %{SOURCE3} $RPM_BUILD_ROOT/lib/udev/rules.d/70-touchpad-quirks.conf
 
 
 %clean
@@ -109,7 +115,7 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man1/synclient.1*
 %{_mandir}/man1/syndaemon.1*
 %doc COPYING README
-%{_sysconfdir}/udev/rules.d/70-touchpad-quirks.conf
+/lib/udev/rules.d/70-touchpad-quirks.conf
 
 %package devel
 Summary:        Xorg X11 synaptics input driver
@@ -127,6 +133,11 @@ Development files for the Synaptics Touc
 
 
 %changelog
+* Thu May 13 2010 Peter Hutterer <peter.hutterer at redhat.com> 1.2.2-5
+- Change ClickFinger defaults to 0 if there's more than one.
+- Add ClickPad support, this requires a kernel patch as well (#590835)
+- pop the udev rule into /lib/udev/rules.d instead of $sysconfigdir
+
 * Mon May 10 2010 Peter Hutterer <peter.hutterer at redhat.com> 1.2.2-4
 - 70-touchpad-rules.conf: label Dell Mini touchpads as broken in udev,
   requiring special config.



More information about the scm-commits mailing list