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

xserver-xorg-input-synaptics: Changes to 'upstream-unstable'



 conf/50-synaptics.conf |   18 +++++++++++++++++
 configure.ac           |    2 -
 man/synaptics.man      |    2 +
 src/eventcomm.c        |    3 +-
 src/synaptics.c        |   51 +++++++++++++++++++++++++++++++++++++++----------
 src/synapticsstr.h     |    2 -
 src/synproto.c         |   13 +++++++++++-
 src/synproto.h         |    1 
 8 files changed, 78 insertions(+), 14 deletions(-)

New commits:
commit 4a80c0dc38ea4dafcb112191c2dd7e0082193263
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Mar 23 10:38:20 2012 +1000

    synaptics 1.5.99.902
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/configure.ac b/configure.ac
index af1bc2a..0a85d13 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-input-synaptics],
-        [1.5.99.901],
+        [1.5.99.902],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-input-synaptics])
 AC_CONFIG_SRCDIR([Makefile.am])

commit b6779458bcdb049480310ba1acb3991ad061ffc7
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Mar 22 15:15:47 2012 +1000

    conf: enable right-button click by default on non-Apple clickpads
    
    The right-half of the bottom 18% of the touchpad are enabled as right button
    by default. On Apple touchpads (these don't have marking for the right
    button) disable them by default.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/conf/50-synaptics.conf b/conf/50-synaptics.conf
index 5ec7e78..822f7a4 100644
--- a/conf/50-synaptics.conf
+++ b/conf/50-synaptics.conf
@@ -24,3 +24,21 @@ Section "InputClass"
         MatchDevicePath "/dev/input/mouse*"
         Option "Ignore" "on"
 EndSection
+
+# This option enables the bottom right corner to be a right button on
+# non-synaptics clickpads.
+# This option is only interpreted by clickpads.
+Section "InputClass"
+        Identifier "Default clickpad buttons"
+        MatchDriver "synaptics"
+        Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0"
+EndSection
+
+# This option disables software buttons on Apple touchpads.
+# This option is only interpreted by clickpads.
+Section "InputClass"
+        Identifier "Disable clickpad buttons on Apple touchpads"
+        MatchProduct "Apple"
+        MatchDriver "synaptics"
+        Option "SoftButtonAreas" "0 0 0 0 0 0 0 0"
+EndSection

commit c9cf8827b129a553ad3cd3d7ee6f463a6e94227d
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Mar 22 15:20:45 2012 +1000

    use xf86SetStrOption for SoftButtonAreas
    
    This way the option is reported in the log when parsed.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/synaptics.c b/src/synaptics.c
index 789de81..f07fd13 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -521,7 +521,7 @@ static void set_softbutton_areas_option(InputInfoPtr pInfo)
     if (!pars->clickpad)
         return;
 
-    option_string = xf86CheckStrOption(pInfo->options, "SoftButtonAreas", NULL);
+    option_string = xf86SetStrOption(pInfo->options, "SoftButtonAreas", NULL);
     if (!option_string)
         return;
 

commit cea97dd5e09b165c2a4b2bbbb5741a03f152ed37
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Mar 14 16:47:26 2012 +1000

    Allow soft button areas to be specified in % of the touchpad
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas@canonical.com>

diff --git a/man/synaptics.man b/man/synaptics.man
index 23862e3..864a95f 100644
--- a/man/synaptics.man
+++ b/man/synaptics.man
@@ -526,6 +526,8 @@ 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 button is assumed to extend to infinity in the given direction.
+Any of the values may be given as percentage of the touchpad width or
+height, whichever applies.
 .
 When the user performs a click within the defined soft button areas, the right
 or middle click action is performed.
diff --git a/src/synaptics.c b/src/synaptics.c
index 3c5b12d..789de81 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -511,10 +511,12 @@ static void set_softbutton_areas_option(InputInfoPtr pInfo)
     SynapticsPrivate *priv = pInfo->private;
     SynapticsParameters *pars = &priv->synpara;
     int values[8];
+    int in_percent = 0; /* bitmask for which ones are in % */
     char *option_string;
     char *next_num;
     char *end_str;
     int i;
+    int width, height;
 
     if (!pars->clickpad)
         return;
@@ -534,12 +536,36 @@ static void set_softbutton_areas_option(InputInfoPtr pInfo)
         values[i] = value;
 
         if (next_num != end_str)
+        {
+            if (end_str && *end_str == '%')
+            {
+                in_percent |= 1 << i;
+                end_str++;
+            }
             next_num = end_str;
-        else
+        } else
             goto fail;
     }
 
-    if (i < 8 || *next_num != '\0' || !SynapticsIsSoftButtonAreasValid(values))
+    if (i < 8 || *next_num != '\0')
+        goto fail;
+
+    width = priv->maxx - priv->minx;
+    height = priv->maxy - priv->miny;
+
+    for (i = 0; in_percent && i < 8; i++)
+    {
+        int base, size;
+
+        if ((in_percent & (1 << i)) == 0 || values[i] == 0)
+            continue;
+
+        size = ((i % 4) < 2) ? width : height;
+        base = ((i % 4) < 2) ? priv->minx : priv->miny;
+        values[i] = base + size * values[i]/100.0;
+    }
+
+    if (!SynapticsIsSoftButtonAreasValid(values))
         goto fail;
 
     memcpy(pars->softbutton_areas[0], values, 4 * sizeof(int));

commit b3348eb7e4e2187e11aa3c1cec2a58512759e6aa
Author: Chase Douglas <chase.douglas@canonical.com>
Date:   Wed Mar 21 12:58:30 2012 -0700

    Include open but unchanged touches when guessing clickfingers
    
    On a clickpad, when the button is pressed the clickfinger guessing will
    only work properly if all touches have new data to report. If a touch
    has not changed, then it will not be counted. This leads to inaccurate
    finger counts.
    
    This change ensures that all active touches are counted. Note that the X
    and Y valuators of active but unchanged touches are still valid.
    
    Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/synaptics.c b/src/synaptics.c
index e22929b..3c5b12d 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2600,8 +2600,8 @@ clickpad_guess_clickfingers(SynapticsPrivate *priv, struct SynapticsHwState *hw)
     for (i = 0; i < hw->num_mt_mask - 1; i++) {
         ValuatorMask *f1;
 
-        /* you can't click on open, you're not fast enough */
-        if (hw->slot_state[i] != SLOTSTATE_UPDATE)
+        if (hw->slot_state[i] == SLOTSTATE_EMPTY ||
+            hw->slot_state[i] == SLOTSTATE_CLOSE)
             continue;
 
         f1 = hw->mt_mask[i];
@@ -2610,7 +2610,8 @@ clickpad_guess_clickfingers(SynapticsPrivate *priv, struct SynapticsHwState *hw)
             ValuatorMask *f2;
             double x1, x2, y1, y2;
 
-            if (hw->slot_state[j] != SLOTSTATE_UPDATE)
+            if (hw->slot_state[j] == SLOTSTATE_EMPTY ||
+                hw->slot_state[j] == SLOTSTATE_CLOSE)
                 continue;
 
             f2 = hw->mt_mask[j];

commit eba82d203e5e817a61180c6510d8de0d063ed05d
Author: Chase Douglas <chase.douglas@canonical.com>
Date:   Wed Mar 21 12:58:29 2012 -0700

    Keep track of which touch slots are open
    
    This change adds a new touch slot state that denotes when the slot is
    open but does not have any new data to report.
    
    Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/eventcomm.c b/src/eventcomm.c
index f199c24..3721c91 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -557,7 +557,8 @@ EventProcessTouchEvent(InputInfoPtr pInfo, struct SynapticsHwState *hw,
     {
         int slot_index = last_mt_vals_slot(priv);
 
-        if (hw->slot_state[slot_index] == SLOTSTATE_EMPTY)
+        if (hw->slot_state[slot_index] == SLOTSTATE_EMPTY ||
+            hw->slot_state[slot_index] == SLOTSTATE_OPEN_EMPTY)
             hw->slot_state[slot_index] = SLOTSTATE_UPDATE;
         if (ev->code == ABS_MT_TRACKING_ID)
         {
diff --git a/src/synproto.c b/src/synproto.c
index bdf2d21..19a13e5 100644
--- a/src/synproto.c
+++ b/src/synproto.c
@@ -152,7 +152,18 @@ SynapticsResetTouchHwState(struct SynapticsHwState *hw)
         for (j = 2; j < valuator_mask_num_valuators(hw->mt_mask[i]); j++)
             valuator_mask_unset(hw->mt_mask[i], j);
 
-        hw->slot_state[i] = SLOTSTATE_EMPTY;
+        switch (hw->slot_state[i])
+        {
+            case SLOTSTATE_OPEN:
+            case SLOTSTATE_OPEN_EMPTY:
+            case SLOTSTATE_UPDATE:
+                hw->slot_state[i] = SLOTSTATE_OPEN_EMPTY;
+                break;
+
+            default:
+                hw->slot_state[i] = SLOTSTATE_EMPTY;
+                break;
+        }
     }
 #endif
 }
diff --git a/src/synproto.h b/src/synproto.h
index 95ebc92..e16aeb0 100644
--- a/src/synproto.h
+++ b/src/synproto.h
@@ -42,6 +42,7 @@ enum SynapticsSlotState
     SLOTSTATE_EMPTY = 0,
     SLOTSTATE_OPEN,
     SLOTSTATE_CLOSE,
+    SLOTSTATE_OPEN_EMPTY,
     SLOTSTATE_UPDATE,
 };
 

commit 73ec252b6f2d25cc49557b1d3789b459b60b8d4e
Author: Chase Douglas <chase.douglas@canonical.com>
Date:   Wed Mar 21 12:58:28 2012 -0700

    Fix clickfinger actions when buttons other than 1 are reported
    
    The "old" logical state now holds the clickfinger action button. In
    order to check for proper clickpad press transition, we need to check if
    any of the left, middle, and right logical button states are pressed.
    
    Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/synaptics.c b/src/synaptics.c
index 9f214e5..e22929b 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2779,7 +2779,8 @@ update_hw_button_state(const InputInfoPtr pInfo, struct SynapticsHwState *hw,
     /* Fingers emulate other buttons. ClickFinger can only be
        triggered on transition, when left is pressed
      */
-    if(hw->left && !old->left && hw->numFingers >= 1) {
+    if(hw->left && !old->left && !old->middle && !old->right &&
+       hw->numFingers >= 1) {
         handle_clickfinger(priv, hw);
     }
 

commit 93c72117e169624854f6eb63591702d7e4dae97c
Author: Chase Douglas <chase.douglas@canonical.com>
Date:   Wed Mar 21 12:58:27 2012 -0700

    Fix clickfinger actions when middle button emulation is enabled
    
    When MBE is enabled, a physical left button press is delayed until a
    timeout is reached. This results in the logical left button being
    depressed while the physical left button is pressed. The physical state
    is stored as the "old" hw state, and it is used for detecting a
    transition from depressed to pressed for clickfinger actions. Since the
    "old" hw state shows the left button pressed, but the current logical
    state shows the left button unpressed, when the MBE timeout fires and we
    set the logical left button pressed the transition check fails.
    
    Since the "old" hw state is only used for clickfinger left button press
    transitions, redefining it to hold the previous logical hw state is
    sufficient for fixing the bug and should not cause any regressions.
    
    Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/synaptics.c b/src/synaptics.c
index 489eeaa..9f214e5 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -1611,7 +1611,6 @@ ReadInput(InputInfoPtr pInfo)
 
 	SynapticsCopyHwState(priv->hwState, hw);
 	delay = HandleState(pInfo, hw, hw->millis, FALSE);
-	SynapticsCopyHwState(priv->old_hw_state, priv->hwState);
 	newDelay = TRUE;
     }
 
@@ -3236,6 +3235,10 @@ HandleState(InputInfoPtr pInfo, struct SynapticsHwState *hw, CARD32 now,
     /* generate a history of the absolute positions */
     if (inside_active_area)
 	store_history(priv, hw->x, hw->y, hw->millis);
+
+    /* Save logical state for transition comparisons */
+    SynapticsCopyHwState(priv->old_hw_state, hw);
+
     return delay;
 }
 
diff --git a/src/synapticsstr.h b/src/synapticsstr.h
index fcefc46..55aab3d 100644
--- a/src/synapticsstr.h
+++ b/src/synapticsstr.h
@@ -196,7 +196,7 @@ struct _SynapticsPrivateRec
     void *proto_data;			/* protocol-specific data */
 
     struct SynapticsHwState *hwState;
-    struct SynapticsHwState *old_hw_state; /* previous hw state */
+    struct SynapticsHwState *old_hw_state; /* previous logical hw state */
 
     const char *device;			/* device node */
     Bool shm_config;			/* True when shared memory area allocated */

commit 5cde789fcafaed47c2533c4315e5c7d5548605f5
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Mar 14 13:24:32 2012 +1000

    Fix inverted circular scrolling direction
    
    Introduced in 26831a6eeac6762ad4d99532f62ebbab0827de10.
    In said commit, the old-style button events were changed to delta
    accumulation. Alas, for circular scrolling, a positive delta is up whereas
    for everything else a positive delta is down.
    
    Reported-by: Thomas Bächler <thomas@archlinux.org>
    Tested-by: Thomas Bächler <thomas@archlinux.org>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas@canonical.com>

diff --git a/src/synaptics.c b/src/synaptics.c
index 898130e..489eeaa 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2552,9 +2552,9 @@ HandleScrolling(SynapticsPrivate *priv, struct SynapticsHwState *hw,
 	double diff = diffa(priv->scroll.last_a, angle(priv, hw->x, hw->y));
 	if (delta >= 0.005 && diff != 0.0) {
 	    if (priv->circ_scroll_vert)
-		priv->scroll.delta_y += diff / delta * para->scroll_dist_vert;
+		priv->scroll.delta_y -= diff / delta * para->scroll_dist_vert;
 	    else
-		priv->scroll.delta_x += diff / delta * para->scroll_dist_horiz;;
+		priv->scroll.delta_x -= diff / delta * para->scroll_dist_horiz;
 	    priv->scroll.last_a = angle(priv, hw->x, hw->y);
         }
     }


Reply to: