Hello community,

here is the log from the commit of package xf86-input-synaptics for 
openSUSE:Factory checked in at 2012-06-10 20:20:27
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/xf86-input-synaptics (Old)
 and      /work/SRC/openSUSE:Factory/.xf86-input-synaptics.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "xf86-input-synaptics", Maintainer is ""

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/xf86-input-synaptics/xf86-input-synaptics.changes    
    2012-05-16 21:11:05.000000000 +0200
+++ 
/work/SRC/openSUSE:Factory/.xf86-input-synaptics.new/xf86-input-synaptics.changes
   2012-06-10 21:52:44.000000000 +0200
@@ -1,0 +2,14 @@
+Wed Jun  6 15:45:07 CEST 2012 - ti...@suse.de
+
+- Remove obsoleted patches and revive LED double-tap (bnc#765524)
+  * Remove obsoleted clickpad patches:
+    xf86-input-synaptics-add-clickpad-support.diff
+    xf86-input-synaptics-fix-clickpad-capabilities.diff
+    xf86-input-synaptics-clickpad-doc-update.diff
+  * Remove obsoleted stability patches:
+    xf86-input-synaptics-filter-bogus-coord.diff
+    xf86-input-synaptics-move-threshold.diff
+  * Revive LED double-tap patch:
+    xf86-input-synaptics-led-double-tap.diff
+
+-------------------------------------------------------------------

Old:
----
  xf86-input-synaptics-add-clickpad-support.diff
  xf86-input-synaptics-clickpad-doc-update.diff
  xf86-input-synaptics-filter-bogus-coord.diff
  xf86-input-synaptics-fix-clickpad-capabilities.diff
  xf86-input-synaptics-move-threshold.diff

New:
----
  xf86-input-synaptics-led-double-tap.diff

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ xf86-input-synaptics.spec ++++++
--- /var/tmp/diff_new_pack.ODceZU/_old  2012-06-10 21:52:45.000000000 +0200
+++ /var/tmp/diff_new_pack.ODceZU/_new  2012-06-10 21:52:45.000000000 +0200
@@ -16,7 +16,6 @@
 #
 
 
-
 Name:           xf86-input-synaptics
 Version:        1.6.1
 Release:        0
@@ -27,13 +26,8 @@
 Source0:        
http://xorg.freedesktop.org/releases/individual/driver/%{name}-%{version}.tar.bz2
 Patch0:         xf86-input-synaptics-wait.diff
 Patch2:         xf86-input-synaptics-xorg.conf.d_snippet.diff
-Patch3:         xf86-input-synaptics-add-clickpad-support.diff
-Patch4:         xf86-input-synaptics-clickpad-doc-update.diff
-Patch5:         xf86-input-synaptics-add-led-support.diff
-Patch7:         xf86-input-synaptics-fix-clickpad-capabilities.diff
-# PATCH-NEEDS-REBASE -- Patch needs to be verified. The current form makes X 
reset.
-Patch9:         xf86-input-synaptics-move-threshold.diff
-Patch10:        xf86-input-synaptics-filter-bogus-coord.diff
+Patch3:         xf86-input-synaptics-add-led-support.diff
+Patch4:         xf86-input-synaptics-led-double-tap.diff
 BuildRequires:  pkg-config
 BuildRequires:  pkgconfig(inputproto)
 BuildRequires:  pkgconfig(mtdev)
@@ -80,11 +74,6 @@
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
-%patch5 -p1
-%patch7 -p1
-# Needs analysis.. the current form resets X when the pad is touched.
-#%patch9 -p1
-%patch10 -p1
 
 %build
 %configure --with-xorg-conf-dir=/etc/X11/xorg.conf.d

++++++ xf86-input-synaptics-led-double-tap.diff ++++++
>From 72867306cc91d02e282c942ca93fa45f03440335 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <ti...@suse.de>
Date: Tue, 15 Jun 2010 16:54:07 +0200
Subject: [PATCH 4/7] Add tap-on-LED feature support

Signed-off-by: Takashi Iwai <ti...@suse.de>
---
 include/synaptics-properties.h |    3 +
 man/synaptics.man              |   17 ++++++
 src/properties.c               |   26 ++++++++++
 src/synaptics.c                |  101 +++++++++++++++++++++++++++++++++++++++++
 src/synapticsstr.h             |    7 ++
 tools/synclient.c              |    1 
 6 files changed, 155 insertions(+)

--- a/include/synaptics-properties.h
+++ b/include/synaptics-properties.h
@@ -170,4 +170,7 @@
 /* 8 bit (BOOL), led_status (on/off) */
 #define SYNAPTICS_PROP_LED_STATUS "Synaptics LED Status"
 
+/* 8 bit (BOOL), double-tap action on LED corner (on/off) */
+#define SYNAPTICS_PROP_LED_DOUBLE_TAP "Synaptics LED Dobule Tap"
+
 #endif                          /* _SYNAPTICS_PROPERTIES_H_ */
--- a/man/synaptics.man
+++ b/man/synaptics.man
@@ -580,6 +580,19 @@ coordinates are less than MaxTapMove uni
 A "touch" event happens when the Z value goes above FingerHigh, and an
 "untouch" event happens when the Z value goes below FingerLow.
 .
+.TP
+.BI "Option \*qLEDDoubleTap\*q \*q" boolean \*q
+.
+Enables/disables the touchpad-control by double-tapping on the top-left
+corner LED.
+.
+Some devices have an LED on the top-left corner to indicate the
+touchpad state.  User can double-tap on the LED to toggle the touchpad
+state.  This option controls whether this action is enabled or not.
+The double-tap size is same as specified in MaxDoubleTapTime.
+The default value is ON.
+Property: "Synaptics LED Double Tap"
+.
 .LP
 The MaxDoubleTapTime parameter has the same function as the MaxTapTime
 parameter, but for the second, third, etc tap in a tap sequence.
@@ -988,6 +1001,10 @@ LED support or not.
 .BI "Synaptics LED Status"
 8 bit (BOOL), the light status of the embedded LED.
 
+.TP 7
+.BI "Synaptics LED Double Tap"
+8 bit (BOOL), enable/disable the double-tap on LED.
+
 .SH "NOTES"
 Configuration through
 .I InputClass
--- a/src/properties.c
+++ b/src/properties.c
@@ -98,6 +98,7 @@ Atom prop_product_id = 0;
 Atom prop_device_node = 0;
 Atom prop_led = 0;
 Atom prop_led_status = 0;
+Atom prop_led_double_tap = 0;
 
 static Atom
 InitTypedAtom(DeviceIntPtr dev, char *name, Atom type, int format, int nvalues,
@@ -385,6 +386,8 @@ InitDeviceProperties(InputInfoPtr pInfo)
     prop_led = InitAtom(pInfo->dev, SYNAPTICS_PROP_LED, 8, 1, &para->has_led);
     prop_led_status = InitAtom(pInfo->dev, SYNAPTICS_PROP_LED_STATUS, 8, 1, 
&para->led_status);
 
+    prop_led_double_tap = InitAtom(pInfo->dev, SYNAPTICS_PROP_LED_DOUBLE_TAP, 
8, 1, &para->led_double_tap);
+
     /* only init product_id property if we actually know them */
     if (priv->id_vendor || priv->id_product) {
         values[0] = priv->id_vendor;
@@ -658,6 +661,18 @@ SetProperty(DeviceIntPtr dev, Atom prope
             return BadValue;
 
         para->touchpad_off = off;
+        if (!checkonly && para->has_led &&
+           para->led_status != para->touchpad_off) {
+            para->led_status = para->touchpad_off;
+            if (priv->proto_ops && priv->proto_ops->UpdateLED)
+                priv->proto_ops->UpdateLED(pInfo);
+        }
+    }
+    else if (property == prop_led_double_tap) {
+        if (prop->size != 1 || prop->format != 8 || prop->type != XA_INTEGER)
+            return BadMatch;
+
+        para->led_double_tap = *(CARD8*)prop->data;
     }
     else if (property == prop_gestures) {
         BOOL *gestures;
@@ -851,3 +866,14 @@ SetProperty(DeviceIntPtr dev, Atom prope
 
     return Success;
 }
+
+void SynapticsToggleOffProperty(DeviceIntPtr dev, Bool off)
+{
+        uint8_t val;
+
+        if (!prop_off)
+                return;
+        val = off;
+        XIChangeDeviceProperty(dev, prop_off, XA_INTEGER, 8,
+                               PropModeReplace, 1, &val, FALSE);
+}
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -152,6 +152,7 @@ static void SanitizeDimensions(InputInfo
 void InitDeviceProperties(InputInfoPtr pInfo);
 int SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
                 BOOL checkonly);
+void SynapticsToggleOffProperty(DeviceIntPtr dev, Bool off);
 
 const static struct {
     const char *name;
@@ -806,6 +807,7 @@ set_default_parameters(InputInfoPtr pInf
         xf86SetIntOption(opts, "HorizResolution", horizResolution);
     pars->resolution_vert =
         xf86SetIntOption(opts, "VertResolution", vertResolution);
+    pars->led_double_tap = xf86SetBoolOption(opts, "LEDDoubleTap", TRUE);
 
     /* Warn about (and fix) incorrectly configured TopEdge/BottomEdge 
parameters */
     if (pars->top_edge > pars->bottom_edge) {
@@ -1120,6 +1122,10 @@ DeviceOn(DeviceIntPtr dev)
     xf86AddEnabledDevice(pInfo);
     dev->public.on = TRUE;
 
+    /* update LED */
+    if (priv->proto_ops && priv->proto_ops->UpdateLED)
+        priv->proto_ops->UpdateLED(pInfo);
+
     return Success;
 }
 
@@ -1649,6 +1655,74 @@ is_inside_middlebutton_area(SynapticsPar
     return is_inside_button_area(para, 1, x, y);
 }
 
+#define LED_TOGGLE_X_AREA      0.10
+#define LED_TOGGLE_Y_AREA      0.08
+
+static int
+in_led_toggle_area(InputInfoPtr pInfo, struct SynapticsHwState *hw)
+{
+    SynapticsPrivate *priv = (SynapticsPrivate *)pInfo->private;
+    int click_led_x, click_led_y;
+
+    click_led_x = (priv->maxx - priv->minx) * LED_TOGGLE_X_AREA + priv->minx;
+    click_led_y = (priv->maxy - priv->miny) * LED_TOGGLE_Y_AREA + priv->miny;
+    return (hw->x < click_led_x && hw->y < click_led_y);
+}
+
+/* clicpad button toggle point:
+ * some devices have a LED at the upper-left corner, and double-tapping it
+ * toggles the touchpad enable/disable
+ */
+static int
+handle_toggle_led(InputInfoPtr pInfo, struct SynapticsHwState *hw, int finger)
+{
+    SynapticsPrivate *priv = (SynapticsPrivate *)pInfo->private;
+    SynapticsParameters *para = &priv->synpara;
+    int diff;
+
+    if (finger) {
+        if (!in_led_toggle_area(pInfo, hw)) {
+            /* outside the toggle area */
+            priv->led_touch_state = FALSE;
+            priv->led_tapped = FALSE;
+            return finger;
+        }
+        if (!priv->led_touch_state) {
+            /* touch start */
+            priv->led_touch_millis = hw->millis;
+            priv->led_touch_state = TRUE;
+        }
+        return 0; /* already processed; ignore this finger event */
+    }
+
+    if (!priv->led_touch_state)
+        return finger; /* nothing happened */
+
+    /* touch-released */
+    priv->led_touch_state = FALSE;
+    diff = TIME_DIFF(priv->led_touch_millis + para->tap_time, hw->millis);
+    if (diff < 0) { /* non-tap? */
+       priv->led_tapped = FALSE;
+        return finger;
+    }
+    if (priv->led_tapped) {
+        /* double-tapped? */
+        diff = TIME_DIFF(priv->led_tap_millis + para->tap_time_2, hw->millis);
+        if (diff >= 0) {
+            para->touchpad_off = !para->touchpad_off;
+            if (priv->proto_ops && priv->proto_ops->UpdateLED) {
+                para->led_status = para->touchpad_off;
+                priv->proto_ops->UpdateLED(pInfo);
+            }
+           priv->prop_change_pending = 1;
+            priv->led_tapped = FALSE;
+        }
+    } else
+        priv->led_tapped = TRUE;
+    priv->led_tap_millis = hw->millis;
+    return 0; /* already processed; ignore this finger event */
+}
+
 static CARD32
 timerFunc(OsTimerPtr timer, CARD32 now, pointer arg)
 {
@@ -1665,6 +1739,15 @@ timerFunc(OsTimerPtr timer, CARD32 now,
     SynapticsResetTouchHwState(hw, FALSE);
     delay = HandleState(pInfo, hw, hw->millis, TRUE);
 
+    if (priv->prop_change_pending)
+       delay = MIN(10, delay);
+
+    if (priv->prop_change_pending) {
+       SynapticsParameters *para = &priv->synpara;
+       SynapticsToggleOffProperty(pInfo->dev, para->touchpad_off);
+       priv->prop_change_pending = 0;
+    }
+
     priv->timer_time = now;
     priv->timer = TimerSet(priv->timer, 0, delay, timerFunc, pInfo);
 
@@ -3269,6 +3352,15 @@ HandleState(InputInfoPtr pInfo, struct S
 
     /* If touchpad is switched off, we skip the whole thing and return delay */
     if (para->touchpad_off == 1) {
+       if (para->has_led && para->led_double_tap) {
+           if (!from_timer)
+               finger = SynapticsDetectFinger(priv, hw);
+           else
+               finger = priv->finger_state;
+           finger = handle_toggle_led(pInfo, hw, finger);
+       }
+    }
+    if (para->touchpad_off == 1) {
         UpdateTouchState(pInfo, hw);
         return delay;
     }
@@ -3312,6 +3404,15 @@ HandleState(InputInfoPtr pInfo, struct S
             finger = priv->finger_state;
     }
 
+    if (para->has_led && para->led_double_tap) {
+       if (inside_active_area)
+           finger = handle_toggle_led(pInfo, hw, finger);
+        if (para->touchpad_off == 1) {
+            priv->finger_state = finger;
+            return delay;
+        }
+    }
+
     /* tap and drag detection. Needs to be performed even if the finger is in
      * the dead area to reset the state. */
     timeleft = HandleTapProcessing(priv, hw, now, finger, inside_active_area);
--- a/src/synapticsstr.h
+++ b/src/synapticsstr.h
@@ -183,6 +183,7 @@ typedef struct _SynapticsParameters {
     int hyst_x, hyst_y;         /* x and y width of hysteresis box */
     Bool has_led;                           /* has an embedded LED */
     Bool led_status;                        /* Current status of LED (1=on) */
+    Bool led_double_tap;                   /* double-tap period in ms for 
touchpad LED control */
 } SynapticsParameters;
 
 struct _SynapticsPrivateRec {
@@ -257,6 +258,12 @@ struct _SynapticsPrivateRec {
     double horiz_coeff;         /* normalization factor for x coordintes */
     double vert_coeff;          /* normalization factor for y coordintes */
 
+    int prop_change_pending;
+    Bool led_touch_state;
+    Bool led_tapped;
+    int led_touch_millis;
+    int led_tap_millis;
+
     int minx, maxx, miny, maxy; /* min/max dimensions as detected */
     int minp, maxp, minw, maxw; /* min/max pressure and finger width as 
detected */
     int resx, resy;             /* resolution of coordinates as detected in 
units/mm */
--- a/tools/synclient.c
+++ b/tools/synclient.c
@@ -154,6 +154,7 @@ static struct Parameter params[] = {
     {"MiddleButtonAreaTop",   PT_INT, INT_MIN, INT_MAX, 
SYNAPTICS_PROP_SOFTBUTTON_AREAS,       32,     6},
     {"MiddleButtonAreaBottom", PT_INT, INT_MIN, INT_MAX, 
SYNAPTICS_PROP_SOFTBUTTON_AREAS,      32,     7},
     {"LEDStatus",             PT_BOOL,   0, 1,     SYNAPTICS_PROP_LED_STATUS,  
8,      0},
+    {"LEDDoubleTap",          PT_BOOL,   0, 1,     
SYNAPTICS_PROP_LED_DOUBLE_TAP,      8,      0},
     { NULL, 0, 0, 0, 0 }
 };
 
-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to