[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xserver-xorg-input-synaptics: Changes to 'ubuntu'



Rebased ref, commits from common ancestor:
commit a337885f15b2aa5cd243f31db730b2e4a5161670
Author: Chase Douglas <chase.douglas@canonical.com>
Date:   Fri Mar 2 10:00:47 2012 -0800

    Disable ClickPad support when there is no physical right button (LP: #941046)
    
    * Disable ClickPad support when there is no physical right button (LP: #941046)
      - This re-enables click actions, which was enabled by default previously
      - Users can enable ClickPad support through xorg.conf, xinput, or synclient
      - See
        https://lists.ubuntu.com/archives/ubuntu-desktop/2012-February/003751.html
        for the discussion guiding this change.
    * Refresh ClickPad support patch with changes from upstream review
      - No new functionality

diff --git a/debian/changelog b/debian/changelog
index 58f4697..f00123c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,17 @@
+xserver-xorg-input-synaptics (1.5.99~git20120223-0ubuntu2) UNRELEASED; urgency=low
+
+  * Disable ClickPad support when there is no physical right button
+    (LP: #941046)
+    - This re-enables click actions, which was enabled by default previously
+    - Users can enable ClickPad support through xorg.conf, xinput, or synclient
+    - See
+      https://lists.ubuntu.com/archives/ubuntu-desktop/2012-February/003751.html
+      for the discussion guiding this change.
+  * Refresh ClickPad support patch with changes from upstream review
+    - No new functionality
+
+ -- Chase Douglas <chase.douglas@ubuntu.com>  Fri, 02 Mar 2012 09:57:11 -0800
+
 xserver-xorg-input-synaptics (1.5.99~git20120223-0ubuntu1) precise; urgency=low
 
   * Update to latest code in git (0a2fd56)
diff --git a/debian/patches/129_clickpad.patch b/debian/patches/129_clickpad.patch
index 9aa048a..33d4fc8 100644
--- a/debian/patches/129_clickpad.patch
+++ b/debian/patches/129_clickpad.patch
@@ -1,7 +1,7 @@
-diff --git a/include/synaptics-properties.h b/include/synaptics-properties.h
-index c550cef..8c20a0c 100644
---- a/include/synaptics-properties.h
-+++ b/include/synaptics-properties.h
+Index: xserver-xorg-input-synaptics/include/synaptics-properties.h
+===================================================================
+--- xserver-xorg-input-synaptics.orig/include/synaptics-properties.h	2012-03-02 11:50:00.000000000 -0800
++++ xserver-xorg-input-synaptics/include/synaptics-properties.h	2012-03-02 11:50:06.235780000 -0800
 @@ -49,6 +49,9 @@
  #define SYNAPTICS_PROP_TAP_DURATIONS "Synaptics Tap Durations"
  
@@ -12,7 +12,7 @@ index c550cef..8c20a0c 100644
  #define SYNAPTICS_PROP_TAP_FAST "Synaptics Tap FastTap"
  
  /* 32 bit */
-@@ -155,6 +158,9 @@
+@@ -158,6 +161,9 @@
  /* 32 bit, 4 values, left, right, top, bottom */
  #define SYNAPTICS_PROP_AREA "Synaptics Area"
  
@@ -22,11 +22,11 @@ index c550cef..8c20a0c 100644
  /* 32 Bit Integer, 2 values, horizontal hysteresis, vertical hysteresis */
  #define SYNAPTICS_PROP_NOISE_CANCELLATION "Synaptics Noise Cancellation"
  
-diff --git a/man/synaptics.man b/man/synaptics.man
-index b6b1dce..f50b249 100644
---- a/man/synaptics.man
-+++ b/man/synaptics.man
-@@ -143,6 +143,12 @@ Maximum time (in milliseconds) for detecting a double tap. Property:
+Index: xserver-xorg-input-synaptics/man/synaptics.man
+===================================================================
+--- xserver-xorg-input-synaptics.orig/man/synaptics.man	2012-03-02 11:50:00.000000000 -0800
++++ xserver-xorg-input-synaptics/man/synaptics.man	2012-03-02 11:50:06.235780000 -0800
+@@ -143,6 +143,12 @@ Maximum time (in milliseconds) for detec
  The duration of the mouse click generated by tapping. Property: "Synaptics Tap
  Durations"
  .TP 7
@@ -39,7 +39,7 @@ index b6b1dce..f50b249 100644
  .BI "Option \*qFastTaps\*q \*q" boolean \*q
  Makes the driver react faster to a single tap, but also makes double
  clicks caused by double tapping slower. Property: "Synaptics Tap FastTap"
-@@ -512,6 +518,20 @@ AreaBottomEdge option to any integer value other than zero. If supported by the
+@@ -524,6 +530,20 @@ AreaBottomEdge option to any integer val
  server (version 1.9 and later), the edge may be specified in percent of
  the total height of the touchpad. Property: "Synaptics Area"
  .
@@ -49,7 +49,7 @@ index b6b1dce..f50b249 100644
 +parameters define the area of the right button, and the second four parameters
 +define the area of the middle button. The areas are defined by the left, right,
 +top, and bottom edges as sequential values of the property. If any edge is set
-+to 0, the edge is assumed to extend to infinity in the given direction.
++to 0, the button is assumed to extend to infinity in the given direction.
 +.
 +When the user performs a click within the defined soft button areas, the right
 +or middle click action is performed.
@@ -60,7 +60,7 @@ index b6b1dce..f50b249 100644
  
  .SH CONFIGURATION DETAILS
  .SS Area handling
-@@ -785,6 +805,10 @@ Properties supported:
+@@ -797,6 +817,10 @@ Properties supported:
  duration of a single click.
  
  .TP 7
@@ -71,7 +71,7 @@ index b6b1dce..f50b249 100644
  .BI "Synaptics Tap FastTap"
  8 bit (BOOL).
  
-@@ -917,6 +941,14 @@ default.
+@@ -933,6 +957,14 @@ default.
  32 bit, 4 values, left, right, top, bottom. 0 disables an element.
  
  .TP 7
@@ -86,11 +86,11 @@ index b6b1dce..f50b249 100644
  .BI "Synaptics Capabilities"
  This read-only property expresses the physical capability of the touchpad,
  most notably whether the touchpad hardware supports multi-finger tapping and
-diff --git a/src/eventcomm.c b/src/eventcomm.c
-index 6147e41..92f99a9 100644
---- a/src/eventcomm.c
-+++ b/src/eventcomm.c
-@@ -526,6 +526,18 @@ SynapticsReadEvent(InputInfoPtr pInfo, struct input_event *ev)
+Index: xserver-xorg-input-synaptics/src/eventcomm.c
+===================================================================
+--- xserver-xorg-input-synaptics.orig/src/eventcomm.c	2012-03-02 11:50:00.207780002 -0800
++++ xserver-xorg-input-synaptics/src/eventcomm.c	2012-03-02 11:50:06.235780000 -0800
+@@ -526,6 +526,18 @@ SynapticsReadEvent(InputInfoPtr pInfo, s
      return rc;
  }
  
@@ -109,7 +109,7 @@ index 6147e41..92f99a9 100644
  static void
  EventProcessTouchEvent(InputInfoPtr pInfo, struct SynapticsHwState *hw,
                         struct input_event *ev)
-@@ -566,8 +578,20 @@ EventProcessTouchEvent(InputInfoPtr pInfo, struct SynapticsHwState *hw,
+@@ -566,8 +578,20 @@ EventProcessTouchEvent(InputInfoPtr pInf
              int map = proto_data->axis_map[ev->code - ABS_MT_TOUCH_MAJOR];
              valuator_mask_set(hw->mt_mask[slot_index], map, ev->value);
              if (slot_index >= 0)
@@ -169,10 +169,10 @@ index 6147e41..92f99a9 100644
      }
  
      mtdev = mtdev_new_open(pInfo->fd);
-diff --git a/src/properties.c b/src/properties.c
-index 0a52801..3828229 100644
---- a/src/properties.c
-+++ b/src/properties.c
+Index: xserver-xorg-input-synaptics/src/properties.c
+===================================================================
+--- xserver-xorg-input-synaptics.orig/src/properties.c	2012-03-02 11:50:00.000000000 -0800
++++ xserver-xorg-input-synaptics/src/properties.c	2012-03-02 11:50:06.239780000 -0800
 @@ -58,6 +58,7 @@ Atom prop_finger                = 0;
  Atom prop_tap_time              = 0;
  Atom prop_tap_move              = 0;
@@ -181,7 +181,7 @@ index 0a52801..3828229 100644
  Atom prop_tap_fast              = 0;
  Atom prop_middle_timeout        = 0;
  Atom prop_twofinger_pressure    = 0;
-@@ -91,6 +92,7 @@ Atom prop_gestures              = 0;
+@@ -92,6 +93,7 @@ Atom prop_gestures              = 0;
  Atom prop_capabilities          = 0;
  Atom prop_resolution            = 0;
  Atom prop_area                  = 0;
@@ -189,7 +189,7 @@ index 0a52801..3828229 100644
  Atom prop_noise_cancellation    = 0;
  Atom prop_product_id            = 0;
  Atom prop_device_node           = 0;
-@@ -189,6 +191,8 @@ InitDeviceProperties(InputInfoPtr pInfo)
+@@ -190,6 +192,8 @@ InitDeviceProperties(InputInfoPtr pInfo)
      values[2] = para->click_time;
  
      prop_tap_durations = InitAtom(pInfo->dev, SYNAPTICS_PROP_TAP_DURATIONS, 32, 3, values);
@@ -198,66 +198,74 @@ index 0a52801..3828229 100644
      prop_tap_fast = InitAtom(pInfo->dev, SYNAPTICS_PROP_TAP_FAST, 8, 1, &para->fast_taps);
      prop_middle_timeout = InitAtom(pInfo->dev, SYNAPTICS_PROP_MIDDLE_TIMEOUT,
                                     32, 1, &para->emulate_mid_button_time);
-@@ -297,6 +301,16 @@ InitDeviceProperties(InputInfoPtr pInfo)
+@@ -298,6 +302,16 @@ InitDeviceProperties(InputInfoPtr pInfo)
      values[3] = para->area_bottom_edge;
      prop_area = InitAtom(pInfo->dev, SYNAPTICS_PROP_AREA, 32, 4, values);
  
-+    values[0] = para->softbutton_right_left_edge;
-+    values[1] = para->softbutton_right_right_edge;
-+    values[2] = para->softbutton_right_top_edge;
-+    values[3] = para->softbutton_right_bottom_edge;
-+    values[4] = para->softbutton_middle_left_edge;
-+    values[5] = para->softbutton_middle_right_edge;
-+    values[6] = para->softbutton_middle_top_edge;
-+    values[7] = para->softbutton_middle_bottom_edge;
++    values[0] = para->softbutton_areas[0][0];
++    values[1] = para->softbutton_areas[0][1];
++    values[2] = para->softbutton_areas[0][2];
++    values[3] = para->softbutton_areas[0][3];
++    values[4] = para->softbutton_areas[1][0];
++    values[5] = para->softbutton_areas[1][1];
++    values[6] = para->softbutton_areas[1][2];
++    values[7] = para->softbutton_areas[1][3];
 +    prop_softbutton_areas = InitAtom(pInfo->dev, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 8, values);
 +
      values[0] = para->hyst_x;
      values[1] = para->hyst_y;
      prop_noise_cancellation = InitAtom(pInfo->dev,
-@@ -392,7 +406,11 @@ SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
+@@ -393,7 +407,25 @@ SetProperty(DeviceIntPtr dev, Atom prope
          para->single_tap_timeout = timeouts[0];
          para->tap_time_2         = timeouts[1];
          para->click_time         = timeouts[2];
 +    } else if (property == prop_clickpad) {
 +        if (prop->size != 1 || prop->format != 8 || prop->type != XA_INTEGER)
 +            return BadMatch;
- 
++
 +        para->clickpad = *(BOOL*)prop->data;
++
++        /* ClickPad support conflicts with click action support. Reset click
++         * actions. The user can override afterwards if they really want. */
++        if (para->clickpad)
++        {
++            CARD8 values[3] = {};
++
++            para->click_action[F1_CLICK1] = 0;
++            para->click_action[F2_CLICK1] = 0;
++            para->click_action[F3_CLICK1] = 0;
+ 
++            XIChangeDeviceProperty(dev, prop_clickaction, XA_INTEGER, 8,
++                                   PropModeReplace, 3, values, TRUE);
++        }
      } else if (property == prop_tap_fast)
      {
          if (prop->size != 1 || prop->format != 8 || prop->type != XA_INTEGER)
-@@ -704,6 +722,25 @@ SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
+@@ -711,6 +743,19 @@ SetProperty(DeviceIntPtr dev, Atom prope
          para->area_right_edge  = area[1];
          para->area_top_edge    = area[2];
          para->area_bottom_edge = area[3];
 +    } else if (property == prop_softbutton_areas)
 +    {
-+        INT32 *areas;
++        int *areas;
 +
 +        if (prop->size != 8 || prop->format != 32 || prop->type != XA_INTEGER)
 +            return BadMatch;
 +
-+        areas = (INT32*)prop->data;
++        areas = (int*)prop->data;
 +        if (!SynapticsIsSoftButtonAreasValid(areas))
 +            return BadValue;
 +
-+        para->softbutton_right_left_edge    = areas[0];
-+        para->softbutton_right_right_edge   = areas[1];
-+        para->softbutton_right_top_edge     = areas[2];
-+        para->softbutton_right_bottom_edge  = areas[3];
-+        para->softbutton_middle_left_edge   = areas[4];
-+        para->softbutton_middle_right_edge  = areas[5];
-+        para->softbutton_middle_top_edge    = areas[6];
-+        para->softbutton_middle_bottom_edge = areas[7];
++        memcpy(para->softbutton_areas[0], areas, 4 * sizeof(int));
++        memcpy(para->softbutton_areas[1], areas + 4, 4 * sizeof(int));
      } else if (property == prop_noise_cancellation) {
          INT32 *hyst;
          if (prop->size != 2 || prop->format != 32 || prop->type != XA_INTEGER)
-diff --git a/src/synaptics.c b/src/synaptics.c
-index 4784157..139f237 100644
---- a/src/synaptics.c
-+++ b/src/synaptics.c
-@@ -410,6 +410,127 @@ static int set_percent_option(pointer options, const char* optname,
+Index: xserver-xorg-input-synaptics/src/synaptics.c
+===================================================================
+--- xserver-xorg-input-synaptics.orig/src/synaptics.c	2012-03-02 11:50:00.000000000 -0800
++++ xserver-xorg-input-synaptics/src/synaptics.c	2012-03-02 11:50:19.495780001 -0800
+@@ -410,6 +410,120 @@ static int set_percent_option(pointer op
      return result;
  }
  
@@ -285,13 +293,13 @@ index 4784157..139f237 100644
 +    /* Check for overlapping button areas */
 +    if (!right_disabled && !middle_disabled)
 +    {
-+        int right_left = values[0] ? values[0] : -INT_MAX;
++        int right_left = values[0] ? values[0] : INT_MIN;
 +        int right_right = values[1] ? values[1] : INT_MAX;
-+        int right_top = values[2] ? values[2] : -INT_MAX;
++        int right_top = values[2] ? values[2] : INT_MIN;
 +        int right_bottom = values[3] ? values[3] : INT_MAX;
-+        int middle_left = values[4] ? values[4] : -INT_MAX;
++        int middle_left = values[4] ? values[4] : INT_MIN;
 +        int middle_right = values[5] ? values[5] : INT_MAX;
-+        int middle_top = values[6] ? values[6] : -INT_MAX;
++        int middle_top = values[6] ? values[6] : INT_MIN;
 +        int middle_bottom = values[7] ? values[7] : INT_MAX;
 +
 +        /* If areas overlap in the Y axis */
@@ -365,27 +373,57 @@ index 4784157..139f237 100644
 +    if (i < 8 || *next_num != '\0' || !SynapticsIsSoftButtonAreasValid(values))
 +        goto fail;
 +
-+    pars->softbutton_right_left_edge = values[0];
-+    pars->softbutton_right_right_edge = values[1];
-+    pars->softbutton_right_top_edge = values[2];
-+    pars->softbutton_right_bottom_edge = values[3];
-+    pars->softbutton_middle_left_edge = values[4];
-+    pars->softbutton_middle_right_edge = values[5];
-+    pars->softbutton_middle_top_edge = values[6];
-+    pars->softbutton_middle_bottom_edge = values[7];
++    memcpy(pars->softbutton_areas[0], values, 4 * sizeof(int));
++    memcpy(pars->softbutton_areas[1], values + 4, 4 * sizeof(int));
 +
 +    return;
 +
 +fail:
-+    xf86IDrvMsg(pInfo, X_WARNING, "invalid SoftButtonAreas value '%s'\n",
++    xf86IDrvMsg(pInfo, X_ERROR, "invalid SoftButtonAreas value '%s', keeping defaults\n",
 +                option_string);
 +}
-+                                      
 +
  static void set_default_parameters(InputInfoPtr pInfo)
  {
      SynapticsPrivate *priv = pInfo->private; /* read-only */
-@@ -534,6 +655,7 @@ static void set_default_parameters(InputInfoPtr pInfo)
+@@ -428,7 +542,7 @@ static void set_default_parameters(Input
+     int pressureMotionMinZ, pressureMotionMaxZ;		/* pressure */
+     int palmMinWidth, palmMinZ;				/* pressure */
+     int tapButton1, tapButton2, tapButton3;
+-    int clickFinger1, clickFinger2, clickFinger3;
++    int clickFinger1 = 0, clickFinger2 = 0, clickFinger3 = 0;
+     Bool vertEdgeScroll, horizEdgeScroll;
+     Bool vertTwoFingerScroll, horizTwoFingerScroll;
+     int horizResolution = 1;
+@@ -488,6 +602,11 @@ static void set_default_parameters(Input
+     palmMinWidth = priv->minw + range * (10.0/16);
+     emulateTwoFingerMinW = priv->minw + range * (7.0/16);
+ 
++    /* Clickpad conflicts with click actions, disable by default unless there
++     * is a physical right button. */
++    if (pars->clickpad && !priv->has_right)
++        pars->clickpad = 0;
++
+     /* Enable tap */
+     tapButton1 = 1;
+     tapButton2 = 2;
+@@ -495,9 +614,12 @@ static void set_default_parameters(Input
+ 
+     /* Enable multifinger-click if only have one physical button,
+        otherwise clickFinger is always button 1. */
+-    clickFinger1 = 1;
+-    clickFinger2 = (priv->has_right || priv->has_middle) ? 1 : 3;
+-    clickFinger3 = 0; /* Disabled by default so three-touch gestures work */
++    if (!pars->clickpad)
++    {
++        clickFinger1 = 1;
++        clickFinger2 = (priv->has_right || priv->has_middle) ? 1 : 3;
++        clickFinger3 = 0; /* Disabled by default so three-touch gestures work */
++    }
+ 
+     /* Enable vert edge scroll */
+     vertEdgeScroll = TRUE;
+@@ -534,6 +656,7 @@ static void set_default_parameters(Input
      pars->tap_move = xf86SetIntOption(opts, "MaxTapMove", tapMove);
      pars->tap_time_2 = xf86SetIntOption(opts, "MaxDoubleTapTime", 180);
      pars->click_time = xf86SetIntOption(opts, "ClickTime", 100);
@@ -393,7 +431,7 @@ index 4784157..139f237 100644
      pars->fast_taps = xf86SetBoolOption(opts, "FastTaps", FALSE);
      pars->emulate_mid_button_time = xf86SetIntOption(opts, "EmulateMidButtonTime", 75);
      pars->emulate_twofinger_z = xf86SetIntOption(opts, "EmulateTwoFingerMinZ", emulateTwoFingerMinZ);
-@@ -601,6 +723,8 @@ static void set_default_parameters(InputInfoPtr pInfo)
+@@ -602,6 +725,8 @@ static void set_default_parameters(Input
  	pars->bottom_edge = tmp;
  	xf86IDrvMsg(pInfo, X_WARNING, "TopEdge is bigger than BottomEdge. Fixing.\n");
      }
@@ -402,7 +440,7 @@ index 4784157..139f237 100644
  }
  
  #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 14
-@@ -1354,6 +1478,60 @@ is_inside_active_area(SynapticsPrivate *priv, int x, int y)
+@@ -1355,6 +1480,60 @@ is_inside_active_area(SynapticsPrivate *
      return inside_area;
  }
  
@@ -411,23 +449,23 @@ index 4784157..139f237 100644
 +{
 +    Bool inside_area = TRUE;
 +
-+    if (para->softbutton_right_left_edge == 0 &&
-+        para->softbutton_right_right_edge == 0 &&
-+        para->softbutton_right_top_edge == 0 &&
-+        para->softbutton_right_bottom_edge == 0)
++    if (para->softbutton_areas[0][0] == 0 &&
++        para->softbutton_areas[0][1] == 0 &&
++        para->softbutton_areas[0][2] == 0 &&
++        para->softbutton_areas[0][3] == 0)
 +        return FALSE;
 +
-+    if (para->softbutton_right_left_edge &&
-+        x < para->softbutton_right_left_edge)
++    if (para->softbutton_areas[0][0] &&
++        x < para->softbutton_areas[0][0])
 +	inside_area = FALSE;
-+    else if (para->softbutton_right_right_edge &&
-+             x > para->softbutton_right_right_edge)
++    else if (para->softbutton_areas[0][1] &&
++             x > para->softbutton_areas[0][1])
 +	inside_area = FALSE;
-+    else if (para->softbutton_right_top_edge &&
-+             y < para->softbutton_right_top_edge)
++    else if (para->softbutton_areas[0][2] &&
++             y < para->softbutton_areas[0][2])
 +	inside_area = FALSE;
-+    else if (para->softbutton_right_bottom_edge &&
-+             y > para->softbutton_right_bottom_edge)
++    else if (para->softbutton_areas[0][3] &&
++             y > para->softbutton_areas[0][3])
 +	inside_area = FALSE;
 +
 +    return inside_area;
@@ -438,23 +476,23 @@ index 4784157..139f237 100644
 +{
 +    Bool inside_area = TRUE;
 +
-+    if (para->softbutton_middle_left_edge == 0 &&
-+        para->softbutton_middle_right_edge == 0 &&
-+        para->softbutton_middle_top_edge == 0 &&
-+        para->softbutton_middle_bottom_edge == 0)
++    if (para->softbutton_areas[1][0] == 0 &&
++        para->softbutton_areas[1][1] == 0 &&
++        para->softbutton_areas[1][2] == 0 &&
++        para->softbutton_areas[1][3] == 0)
 +        return FALSE;
 +
-+    if (para->softbutton_middle_left_edge &&
-+        x < para->softbutton_middle_left_edge)
++    if (para->softbutton_areas[1][0] &&
++        x < para->softbutton_areas[1][0])
 +	inside_area = FALSE;
-+    else if (para->softbutton_middle_right_edge &&
-+             x > para->softbutton_middle_right_edge)
++    else if (para->softbutton_areas[1][1] &&
++             x > para->softbutton_areas[1][1])
 +	inside_area = FALSE;
-+    else if (para->softbutton_middle_top_edge &&
-+             y < para->softbutton_middle_top_edge)
++    else if (para->softbutton_areas[1][2] &&
++             y < para->softbutton_areas[1][2])
 +	inside_area = FALSE;
-+    else if (para->softbutton_middle_bottom_edge &&
-+             y > para->softbutton_middle_bottom_edge)
++    else if (para->softbutton_areas[1][3] &&
++             y > para->softbutton_areas[1][3])
 +	inside_area = FALSE;
 +
 +    return inside_area;
@@ -463,7 +501,7 @@ index 4784157..139f237 100644
  static CARD32
  timerFunc(OsTimerPtr timer, CARD32 now, pointer arg)
  {
-@@ -1410,6 +1588,14 @@ ReadInput(InputInfoPtr pInfo)
+@@ -1411,6 +1590,14 @@ ReadInput(InputInfoPtr pInfo)
      SynapticsResetTouchHwState(hw);
  
      while (SynapticsGetHwState(pInfo, priv, hw)) {
@@ -478,7 +516,7 @@ index 4784157..139f237 100644
  	SynapticsCopyHwState(priv->hwState, hw);
  	delay = HandleState(pInfo, hw, hw->millis, FALSE);
  	newDelay = TRUE;
-@@ -1691,7 +1877,7 @@ HandleTapProcessing(SynapticsPrivate *priv, struct SynapticsHwState *hw,
+@@ -1692,7 +1879,7 @@ HandleTapProcessing(SynapticsPrivate *pr
  		    Bool inside_active_area)
  {
      SynapticsParameters *para = &priv->synpara;
@@ -487,7 +525,7 @@ index 4784157..139f237 100644
      int timeleft, timeout;
      edge_type edge;
      int delay = 1000000000;
-@@ -1705,6 +1891,7 @@ HandleTapProcessing(SynapticsPrivate *priv, struct SynapticsHwState *hw,
+@@ -1706,6 +1893,7 @@ HandleTapProcessing(SynapticsPrivate *pr
  	     (priv->tap_max_fingers <= ((priv->horiz_scroll_twofinger_on || priv->vert_scroll_twofinger_on)? 2 : 1)) &&
  	     ((abs(hw->x - priv->touch_on.x) >= para->tap_move) ||
  	     (abs(hw->y - priv->touch_on.y) >= para->tap_move)));
@@ -495,7 +533,7 @@ index 4784157..139f237 100644
  
      if (touch) {
  	priv->touch_on.x = hw->x;
-@@ -1727,6 +1914,10 @@ HandleTapProcessing(SynapticsPrivate *priv, struct SynapticsHwState *hw,
+@@ -1728,6 +1916,10 @@ HandleTapProcessing(SynapticsPrivate *pr
  	    SetTapState(priv, TS_1, now);
  	break;
      case TS_1:
@@ -506,7 +544,7 @@ index 4784157..139f237 100644
  	if (move) {
  	    SetMovingState(priv, MS_TOUCHPAD_RELATIVE, now);
  	    SetTapState(priv, TS_MOVE, now);
-@@ -1750,6 +1941,10 @@ HandleTapProcessing(SynapticsPrivate *priv, struct SynapticsHwState *hw,
+@@ -1751,6 +1943,10 @@ HandleTapProcessing(SynapticsPrivate *pr
  	}
  	break;
      case TS_MOVE:
@@ -517,7 +555,7 @@ index 4784157..139f237 100644
  	if (move && priv->moving_state == MS_TRACKSTICK) {
  	    SetMovingState(priv, MS_TOUCHPAD_RELATIVE, now);
  	}
-@@ -1804,6 +1999,10 @@ HandleTapProcessing(SynapticsPrivate *priv, struct SynapticsHwState *hw,
+@@ -1805,6 +2001,10 @@ HandleTapProcessing(SynapticsPrivate *pr
  	}
  	break;
      case TS_DRAG:
@@ -528,7 +566,7 @@ index 4784157..139f237 100644
  	if (move)
  	    SetMovingState(priv, MS_TOUCHPAD_RELATIVE, now);
  	if (release) {
-@@ -1832,6 +2031,23 @@ HandleTapProcessing(SynapticsPrivate *priv, struct SynapticsHwState *hw,
+@@ -1833,6 +2033,23 @@ HandleTapProcessing(SynapticsPrivate *pr
  	    SetTapState(priv, TS_START, now);
  	}
  	break;
@@ -552,7 +590,7 @@ index 4784157..139f237 100644
      }
  
      timeout = GetTimeOut(priv);
-@@ -1954,9 +2170,8 @@ get_delta(SynapticsPrivate *priv, const struct SynapticsHwState *hw,
+@@ -1955,9 +2172,8 @@ get_delta(SynapticsPrivate *priv, const
      int x_edge_speed = 0;
      int y_edge_speed = 0;
  
@@ -564,7 +602,7 @@ index 4784157..139f237 100644
  
      if ((priv->tap_state == TS_DRAG) || para->edge_motion_use_always)
          get_edge_speed(priv, hw, edge, &x_edge_speed, &y_edge_speed);
-@@ -2025,7 +2240,7 @@ ComputeDeltas(SynapticsPrivate *priv, const struct SynapticsHwState *hw,
+@@ -2026,7 +2242,7 @@ ComputeDeltas(SynapticsPrivate *priv, co
       * POLL_MS declaration. */
      delay = MIN(delay, POLL_MS);
  
@@ -573,7 +611,7 @@ index 4784157..139f237 100644
          goto out; /* skip the lot */
  
      if (priv->moving_state == MS_TRACKSTICK)
-@@ -2467,8 +2682,24 @@ update_hw_button_state(const InputInfoPtr pInfo, struct SynapticsHwState *hw,
+@@ -2468,6 +2684,22 @@ update_hw_button_state(const InputInfoPt
      /* 3rd button emulation */
      hw->middle |= HandleMidButtonEmulation(priv, hw, now, delay);
  
@@ -594,28 +632,9 @@ index 4784157..139f237 100644
 +    }
 +
      /* Fingers emulate other buttons */
--    if(hw->left && hw->numFingers >= 1){
-+    if(!para->clickpad && hw->left && hw->numFingers >= 1){
+     if(hw->left && hw->numFingers >= 1){
          handle_clickfinger(para, hw);
-     }
- 
-@@ -2643,10 +2874,12 @@ HandleTouches(InputInfoPtr pInfo, struct SynapticsHwState *hw)
-     Bool restart_touches = FALSE;
-     int i;
- 
--    if (para->click_action[F3_CLICK1] || para->tap_action[F3_TAP])
-+    if ((!para->clickpad && para->click_action[F3_CLICK1]) ||
-+        para->tap_action[F3_TAP])
-         min_touches = 4;
--    else if (para->click_action[F2_CLICK1] || para->tap_action[F2_TAP] ||
--             para->scroll_twofinger_vert || para->scroll_twofinger_horiz)
-+    else if ((!para->clickpad && para->click_action[F2_CLICK1]) ||
-+             para->tap_action[F2_TAP] || para->scroll_twofinger_vert ||
-+             para->scroll_twofinger_horiz)
-         min_touches = 3;
- 
-     /* Count new number of active touches */
-@@ -2658,6 +2891,9 @@ HandleTouches(InputInfoPtr pInfo, struct SynapticsHwState *hw)
+@@ -2659,6 +2891,9 @@ HandleTouches(InputInfoPtr pInfo, struct
              new_active_touches--;
      }
  
@@ -625,7 +644,7 @@ index 4784157..139f237 100644
      if (priv->num_active_touches < min_touches &&
          new_active_touches < min_touches)
      {
-@@ -2751,6 +2987,14 @@ HandleState(InputInfoPtr pInfo, struct SynapticsHwState *hw, CARD32 now,
+@@ -2752,6 +2987,14 @@ HandleState(InputInfoPtr pInfo, struct S
  	return delay;
      }
  
@@ -640,10 +659,10 @@ index 4784157..139f237 100644
      /* apply hysteresis before doing anything serious. This cancels
       * out a lot of noise which might surface in strange phenomena
       * like flicker in scrolling or noise motion. */
-diff --git a/src/synapticsstr.h b/src/synapticsstr.h
-index ba1eb13..baee4d9 100644
---- a/src/synapticsstr.h
-+++ b/src/synapticsstr.h
+Index: xserver-xorg-input-synaptics/src/synapticsstr.h
+===================================================================
+--- xserver-xorg-input-synaptics.orig/src/synapticsstr.h	2012-03-02 11:50:00.000000000 -0800
++++ xserver-xorg-input-synaptics/src/synapticsstr.h	2012-03-02 11:50:06.239780000 -0800
 @@ -99,7 +99,8 @@ enum TapState {
      TS_3,			/* After second touch */
      TS_DRAG,			/* Pointer drag enabled */
@@ -662,22 +681,15 @@ index ba1eb13..baee4d9 100644
      Bool fast_taps;			    /* Faster reaction to single taps */
      int emulate_mid_button_time;	    /* Max time between left and right button presses to
  					       emulate a middle button press. */
-@@ -178,6 +180,14 @@ typedef struct _SynapticsParameters
+@@ -179,6 +181,7 @@ typedef struct _SynapticsParameters
      unsigned int resolution_horiz;          /* horizontal resolution of touchpad in units/mm */
      unsigned int resolution_vert;           /* vertical resolution of touchpad in units/mm */
      int area_left_edge, area_right_edge, area_top_edge, area_bottom_edge; /* area coordinates absolute */
-+    int softbutton_right_left_edge;
-+    int softbutton_right_right_edge;
-+    int softbutton_right_top_edge;
-+    int softbutton_right_bottom_edge;
-+    int softbutton_middle_left_edge;
-+    int softbutton_middle_right_edge;
-+    int softbutton_middle_top_edge;
-+    int softbutton_middle_bottom_edge;       /* soft button area coordinates absolute */
++    int softbutton_areas[2][4];             /* soft button area coordinates, 0 => right, 1 => middle button */
      int hyst_x, hyst_y;                     /* x and y width of hysteresis box */
  } SynapticsParameters;
  
-@@ -265,6 +275,7 @@ typedef struct _SynapticsPrivateRec
+@@ -266,6 +269,7 @@ typedef struct _SynapticsPrivateRec
      Bool has_pressure;			/* device reports pressure */
      Bool has_width;			/* device reports finger width */
      Bool has_scrollbuttons;		/* device has physical scrollbuttons */
@@ -685,11 +697,11 @@ index ba1eb13..baee4d9 100644
  
      enum TouchpadModel model;		/* The detected model */
      unsigned short id_vendor;		/* vendor id */
-diff --git a/src/synproto.c b/src/synproto.c
-index 0426e8f..e945f1e 100644
---- a/src/synproto.c
-+++ b/src/synproto.c
-@@ -120,6 +120,8 @@ SynapticsCopyHwState(struct SynapticsHwState *dst,
+Index: xserver-xorg-input-synaptics/src/synproto.c
+===================================================================
+--- xserver-xorg-input-synaptics.orig/src/synproto.c	2012-03-02 11:50:00.000000000 -0800
++++ xserver-xorg-input-synaptics/src/synproto.c	2012-03-02 11:50:06.239780000 -0800
+@@ -120,6 +120,8 @@ SynapticsCopyHwState(struct SynapticsHwS
      dst->x = src->x;
      dst->y = src->y;
      dst->z = src->z;
@@ -698,10 +710,10 @@ index 0426e8f..e945f1e 100644
      dst->numFingers = src->numFingers;
      dst->fingerWidth = src->fingerWidth;
      dst->left = src->left;
-diff --git a/src/synproto.h b/src/synproto.h
-index 89392ac..3b9f803 100644
---- a/src/synproto.h
-+++ b/src/synproto.h
+Index: xserver-xorg-input-synaptics/src/synproto.h
+===================================================================
+--- xserver-xorg-input-synaptics.orig/src/synproto.h	2012-03-02 11:50:00.000000000 -0800
++++ xserver-xorg-input-synaptics/src/synproto.h	2012-03-02 11:50:06.239780000 -0800
 @@ -53,6 +53,8 @@ struct SynapticsHwState {
      int x;			/* X position of finger */
      int y;			/* Y position of finger */
@@ -711,18 +723,18 @@ index 89392ac..3b9f803 100644
      int numFingers;
      int fingerWidth;
  
-@@ -115,4 +117,6 @@ extern void SynapticsCopyHwState(struct SynapticsHwState *dst,
+@@ -115,4 +117,6 @@ extern void SynapticsCopyHwState(struct
                                   const struct SynapticsHwState *src);
  extern void SynapticsResetTouchHwState(struct SynapticsHwState *hw);
  
 +extern Bool SynapticsIsSoftButtonAreasValid(int *values);
 +
  #endif /* _SYNPROTO_H_ */
-diff --git a/test/fake-symbols.c b/test/fake-symbols.c
-index 7f3f0ac..65fad46 100644
---- a/test/fake-symbols.c
-+++ b/test/fake-symbols.c
-@@ -461,6 +461,11 @@ _X_EXPORT void valuator_mask_free(ValuatorMask **mask)
+Index: xserver-xorg-input-synaptics/test/fake-symbols.c
+===================================================================
+--- xserver-xorg-input-synaptics.orig/test/fake-symbols.c	2012-03-02 11:50:00.000000000 -0800
++++ xserver-xorg-input-synaptics/test/fake-symbols.c	2012-03-02 11:50:06.239780000 -0800
+@@ -461,6 +461,11 @@ _X_EXPORT void valuator_mask_free(Valuat
  {
  }
  
@@ -734,3 +746,31 @@ index 7f3f0ac..65fad46 100644
  _X_EXPORT void valuator_mask_set(ValuatorMask *mask, int valuator, int data)
  {
  }
+Index: xserver-xorg-input-synaptics/tools/synclient.c
+===================================================================
+--- xserver-xorg-input-synaptics.orig/tools/synclient.c	2012-03-02 11:50:00.000000000 -0800
++++ xserver-xorg-input-synaptics/tools/synclient.c	2012-03-02 11:50:06.243780000 -0800
+@@ -38,6 +38,7 @@
+ #include <string.h>
+ #include <stddef.h>
+ #include <math.h>
++#include <limits.h>
+ 
+ #include <X11/Xdefs.h>
+ #include <X11/Xatom.h>
+@@ -144,6 +145,15 @@ static struct Parameter params[] = {
+     {"AreaRightEdge",         PT_INT,    0, 10000, SYNAPTICS_PROP_AREA,	32,	1},
+     {"AreaTopEdge",           PT_INT,    0, 10000, SYNAPTICS_PROP_AREA,	32,	2},
+     {"AreaBottomEdge",        PT_INT,    0, 10000, SYNAPTICS_PROP_AREA,	32,	3},
++    {"ClickPad",              PT_BOOL,   0, 1,     SYNAPTICS_PROP_CLICKPAD,	8,	0},
++    {"RightButtonAreaLeft",   PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS,	32,	0},
++    {"RightButtonAreaRight",  PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS,	32,	1},
++    {"RightButtonAreaTop",    PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS,	32,	2},
++    {"RightButtonAreaBottom", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS,	32,	3},
++    {"MiddleButtonAreaLeft",  PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS,	32,	4},
++    {"MiddleButtonAreaRight", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS,	32,	5},
++    {"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},
+     { NULL, 0, 0, 0, 0 }
+ };
+ 


Reply to: