[PATCH xf86-input-synaptics v4 02/10] Check for clickpad property

Peter Hutterer peter.hutterer at who-t.net
Sun Mar 4 22:08:37 PST 2012


On Fri, Mar 02, 2012 at 12:42:28PM -0800, Chase Douglas wrote:
> However, only enable it by default if a right button is physically
> present. Clickpad support conflicts with click action support, so the
> user would be left without right button support if there is no physical
> right button.

uhm, is there any clickpad with a physical right button? painted-on, yes.
but devices that actually report BTN_RIGHT?

Cheers,
  Peter

> Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
> ---
>  src/eventcomm.c |    7 +++++++
>  src/synaptics.c |    7 ++++++-
>  2 files changed, 13 insertions(+), 1 deletions(-)
> 
> diff --git a/src/eventcomm.c b/src/eventcomm.c
> index 6147e41..60be6fe 100644
> --- a/src/eventcomm.c
> +++ b/src/eventcomm.c
> @@ -713,6 +713,7 @@ static void
>  event_query_touch(InputInfoPtr pInfo)
>  {
>      SynapticsPrivate *priv = (SynapticsPrivate *)pInfo->private;
> +    SynapticsParameters *para = &priv->synpara;
>      struct eventcomm_proto_data *proto_data = priv->proto_data;
>      struct mtdev *mtdev;
>      int i;
> @@ -730,6 +731,12 @@ event_query_touch(InputInfoPtr pInfo)
>          return;
>      }
>  
> +    if (rc >= 0 && BitIsOn(&prop, INPUT_PROP_BUTTONPAD))
> +    {
> +        xf86IDrvMsg(pInfo, X_INFO, "found clickpad property\n");
> +        para->clickpad = TRUE;
> +    }
> +
>      mtdev = mtdev_new_open(pInfo->fd);
>      if (!mtdev)
>      {
> diff --git a/src/synaptics.c b/src/synaptics.c
> index 4f6b65f..64e87da 100644
> --- a/src/synaptics.c
> +++ b/src/synaptics.c
> @@ -488,6 +488,11 @@ static void set_default_parameters(InputInfoPtr pInfo)
>      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 if we don't have a phys left button */
>      tapButton1 = priv->has_left ? 0 : 1;
>      tapButton2 = priv->has_left ? 0 : 3;
> @@ -534,7 +539,7 @@ static void set_default_parameters(InputInfoPtr pInfo)
>      pars->tap_move = xf86SetIntOption(opts, "MaxTapMove", tapMove);
>      pars->tap_time_2 = xf86SetIntOption(opts, "MaxDoubleTapTime", 180);
>      pars->click_time = xf86SetIntOption(opts, "ClickTime", 100);
> -    pars->clickpad = xf86SetIntOption(opts, "ClickPad", FALSE);
> +    pars->clickpad = xf86SetIntOption(opts, "ClickPad", pars->clickpad); /* Probed */
>      pars->fast_taps = xf86SetBoolOption(opts, "FastTaps", FALSE);
>      pars->emulate_mid_button_time = xf86SetIntOption(opts, "EmulateMidButtonTime", 75);
>      pars->emulate_twofinger_z = xf86SetIntOption(opts, "EmulateTwoFingerMinZ", emulateTwoFingerMinZ);
> -- 
> 1.7.9
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
> 


More information about the xorg-devel mailing list