Commit graph

4 commits

Author SHA1 Message Date
David Santamaría Rogado
3cf723451f quirks: Add generic Synaptics quirk found in HP ones
This quirk is a generic one for all the HP laptops with haptic touchpad
so makes more sense here because we are applying it dmi independent
being more difficult to track this change if the touchpad became used in
other vendors.

Signed-off-by: David Santamaría Rogado <howl.nsp@gmail.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1378>
2025-12-16 16:35:22 +01:00
Peter Hutterer
a7e4cbc212 quirks: allow overriding of AttrEventCode and AttrInputProp
This switches the quirk from AttrEventCodeEnable/Disable to just
AttrEventCode with a +/- prefix for each entry.
This switches the quirk from AttrInputPropEnable/Disable to just
AttrInputProp with a +/- prefix for each entry.

Previously, both event codes and input props would only apply the
last-matching section entry for a device. Furthermore, an earlier Disable entry
would take precedence over a later Enable entry. For example, a set of
sections with these lines *should* enable left, right and middle:

  [first]
  AttrEventCodeEnable=BTN_LEFT;BTN_RIGHT;BTN_MIDDLE

  [second]
  AttrEventCodeDisable=BTN_RIGHT

  [third]
  AttrEventCodeEnable=BTN_LEFT;BTN_RIGHT;

Alas: the first line was effectively ignored (quirks only returned the
last-matching one, i.e. the one from "third"). And due to implementation
details in evdev.c, the Disable attribute was processed after Enable,
i.e. the device was enabled for left + right and then disabled for
right. As a result, the device only had BTN_LEFT enabled.

Fix this by changing the attribute to carry both enable/disable
information and merging the commands together.

Internally, all quirks matching a device are simply ref'd into an array
in the struct quirks. The applied value is simply the last entry in the
array corresponding to our quirk.

For AttrEventCode and AttrInputProp instead do this:
- switch them to a tuple with the code as first entry and a boolean
  enable/disable as second entry
- if the struct quirk already has an entry for either, append the more
  recent one to the existing entry (instead of creating a new entry in
  the array). This way we have all entries that match and in-order of
  precedence - i.e. we can process them left-to-right to end up
  with the right state.

Fixes: https://gitlab.freedesktop.org/libinput/libinput/-/issues/821

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-11-28 08:25:41 +10:00
Peter Hutterer
d1f274c781 quirks: add a more generic match for the 5288 Synaptics clickpad
This is a clickpad announcing BTN_RIGHT in different machines, see
issue #674, #689, #629 and MR !701. There are at least 4 machines that
ship with this device that we had to quirk independently, possibly
others so disabling BTN_RIGHT on all of them makes sense.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-11-10 22:19:48 +00:00
Peter Hutterer
e6cad92005 Rename data/ to quirks/
A better, less ambiguous name than just "datadir"

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-13 13:30:54 +10:00
Renamed from data/30-vendor-synaptics.quirks (Browse further)