Compare commits

...

23 commits
main ... 1.4.3

Author SHA1 Message Date
Peter Hutterer
8f525f3583 configure.ac: libinput 1.4.3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-09-22 18:04:26 +10:00
Peter Hutterer
b8f05776e9 touchpad: require at least 3 events before enabling trackpoint palm detection
Some trackpoints, notably the one on the Lenovo T460s have a tendency to send
the odd event even when they're not actually used. Trackpoint events trigger
palm detection (see 0210f1fee1) and thus effectively disable the touchpad,
causing the touchpad to appear nonresponsive.

Fix this by requiring at least 3 events from a trackpoint before palm
detection is enabled. For normal use it's hard enough to trigger a single
event anyway so this should not affect the normal use-case.

https://bugzilla.redhat.com/show_bug.cgi?id=1364850

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 416fa44d80)
2016-09-22 17:44:26 +10:00
Peter Hutterer
0e8f82eb39 test: add trackpoint palm detection tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit df781aad2f)
2016-09-22 17:44:22 +10:00
Peter Hutterer
a4c0473b8b doc: specify the https path for mathjax
freedesktop.org always serves https for the documentation. if Mathjax is
pulled in from http, browsers reject it [1]

Let's take the default doxygen value but just add the https to it. In the
future we should just ship a copy of mathjax with our documentation.

[1] https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content/How_to_fix_website_with_mixed_content

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Wheres-my-beer-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
(cherry picked from commit 31a168abcd)
2016-09-22 17:43:37 +10:00
Peter Hutterer
79b12c5375 udev: fix hwdb match for the HP Stream 11
prefix must be libinput, not evdev

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit f43a072d2c)
2016-09-20 16:37:19 +10:00
Peter Hutterer
66e5305034 Force the HP Stream 11 touchpad as a clickpad
INPUT_PROP_BUTTONPAD is not set on this device and RMI4 which should fix this
is a bit too far into the future at this point. Hack around it.

https://bugs.freedesktop.org/show_bug.cgi?id=97147

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 18adfed4c1)
2016-09-20 16:35:50 +10:00
Peter Hutterer
1390314122 udev: add missing touchpad model name for the HP 8510w
(cherry picked from commit 43a8502ecf)
2016-09-20 16:35:33 +10:00
Peter Hutterer
68eef4e154 tablet: if a serial comes in late, discard it
If a tool starts reporting with serial 0 and later updates to a real serial,
discard that serial and keep reporting as serial 0. We cannot really change
the tool after proximity in as we don't know when callers query for the serial
(well, we could know but any well-written caller will ask for the serial on
the proximity in event, so what's the point).

Thus if we do get a serial in and the matching tool, check if we have a tool
with the serial 0 already. If so, re-use that. This means we lose correct tool
tracking on such tablets but so far these seem to only be on devices where the
use of multiple tools is unlikely.

https://bugs.freedesktop.org/show_bug.cgi?id=97526

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
(cherry picked from commit d686e13338)
2016-09-06 15:42:15 +10:00
Peter Hutterer
7b0b5d66c1 test: add a Wacom HID 4800 test device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
(cherry picked from commit 9550cd47b2)
2016-09-06 15:42:15 +10:00
Peter Hutterer
2f2132aa39 evdev: add quirk for the HP85810 touchpad
The touchpad's says it can do two- and three-finger detection but it never
sends events for it. Disable them so we treat it as pure single-finger
touchpad.

https://bugzilla.redhat.com/show_bug.cgi?id=1351285

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 64c8939911)
2016-09-06 15:40:32 +10:00
Peter Hutterer
32d383b7f9 test: add the valgrind test suite output to the distcleanfiles
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 3ecd389c94)
2016-09-06 15:39:33 +10:00
Peter Hutterer
2b909846c1 configure.ac: libinput 1.4.2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-30 16:49:49 +10:00
Peter Hutterer
4386453716 touchpad: always reset the motion history on finger changes
We've already been doing this for semi-mt devices and for non-clickpads but
let's do it for clickpads as well. On Synaptics touchpads (PS/2 and RMI4)
we see slot jumps where two slots are active, slot X ends but slot Y continues
with the other slot's positional data. This causes a cursor jump on finger
lift after a two-finger scrolling motion. Simply resetting the motion history fixes it.

The only multi-finger interaction where a user could expect perfect fluid
motion is when using a second finger to touch cone of the software button
areas. Let's see if we have complaints first before we implement something
more complex.

https://bugs.freedesktop.org/show_bug.cgi?id=91695

Signed-off-by:Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit aa87d2b25b)
2016-08-30 15:59:10 +10:00
Peter Hutterer
5582a13eba test: prevent cursor jumps in the various tap tests
Probably a copied typo in the original tests, 5 events with 40ms in between
makes less sense than the now-replacement 20 events every 2ms. The previous
one could trigger the cursor jump detection.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit bc9e9267f0)
2016-08-30 15:59:09 +10:00
Peter Hutterer
63c9d2dcb0 touchpad: reset the edge scroll state on touch up if edge scroll is disabled
If a touch was down (and up again) before the device was switched to edge
scrolling, libinput reported an error message:
  litest error: libinput bug: unexpected scroll event 0 in area state

While edge scrolling was disabled, any new touch would be set to the area
state but it was never reset on touch release.

https://bugs.freedesktop.org/show_bug.cgi?id=97425

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit b1a811ee52)
2016-08-30 15:58:54 +10:00
Peter Hutterer
cb7cef6f4b touchpad: on a non-clickpad, reset the motion history on nfingers change
The only reason to have more than one finger on a non-clickpad is to tap,
scroll or gesture. In all cases resetting the motion history is a good idea to
avoid jumps moving from 2 to 1 finger.

https://bugs.freedesktop.org/show_bug.cgi?id=97194

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 3cb60130c1)
2016-08-30 15:58:47 +10:00
Peter Hutterer
865fc1fa65 doc: fix wrong argument to udevadm hwdb
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 60c8b07695)
2016-08-18 15:36:55 +10:00
Peter Hutterer
23388c99c3 libinput 1.4.1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-05 11:30:41 +10:00
Peter Hutterer
657c087286 doc: add some info about configuring devices in wayland/xorg
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit ae30353a73)
2016-08-05 11:29:22 +10:00
Peter Hutterer
6614604e9a touchpad: use the udev ID_INPUT_TOUCHPAD_INTEGRATION property if available
udev now labels touchpads as "internal" or "external" for us, use that value
where available and only fall back onto our own labelling if it's missing or
unknown.

systemd commit: https://github.com/systemd/systemd/pull/3638

https://bugs.freedesktop.org/show_bug.cgi?id=96735

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 64e3941189)
2016-08-05 08:58:34 +10:00
Peter Hutterer
d7d64d9871 doc: add links to the two debugging tools as examples
These are the simplest examples on how to use libinput and should be enough to
get any potential user started.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 14d0cd9d38)
2016-08-05 08:58:28 +10:00
Peter Hutterer
33a6613671 udev: don't overwrite a previously set device group
In some cases a device may need a device group assigned by a custom udev rule
or hwdb entry. Don't overwrite that with our generated one.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 188bad4866)
2016-08-05 08:58:17 +10:00
Peter Hutterer
92be97b045 evdev: prefix "tablet unknown to libwacom" error with the device name
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 45a574a785)
2016-08-05 08:58:13 +10:00
20 changed files with 539 additions and 20 deletions

View file

@ -67,6 +67,23 @@ http://wayland.freedesktop.org/libinput/doc/latest/modules.html
High-level documentation about libinput's features: High-level documentation about libinput's features:
http://wayland.freedesktop.org/libinput/doc/latest/pages.html http://wayland.freedesktop.org/libinput/doc/latest/pages.html
Examples of how to use libinput are the debugging tools in the libinput
repository. Developers are encouraged to look at those tools for a
real-world (yet simple) example on how to use libinput.
- A commandline debugging tool: https://cgit.freedesktop.org/wayland/libinput/tree/tools/event-debug.c
- A GTK application that draws cursor/touch/tablet positions: https://cgit.freedesktop.org/wayland/libinput/tree/tools/event-gui.c
libinput provides a
[pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/) file.
Usually a program will use the `PKG_CHECK_MODULES` autoconf macro.
Otherwise, the most rudimentary way to compile and link a program against
libinput is:
gcc -o myprogram myprogram.c `pkg-config --cflags --libs libinput`
For further information on using pkgconfig see the pkg-config documentation.
License License
------- -------

View file

@ -2,7 +2,7 @@ AC_PREREQ([2.64])
m4_define([libinput_major_version], [1]) m4_define([libinput_major_version], [1])
m4_define([libinput_minor_version], [4]) m4_define([libinput_minor_version], [4])
m4_define([libinput_micro_version], [0]) m4_define([libinput_micro_version], [3])
m4_define([libinput_version], m4_define([libinput_version],
[libinput_major_version.libinput_minor_version.libinput_micro_version]) [libinput_major_version.libinput_minor_version.libinput_micro_version])
@ -35,7 +35,7 @@ AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz])
# b) If interfaces have been changed or added, but binary compatibility has # b) If interfaces have been changed or added, but binary compatibility has
# been preserved, change to C+1:0:A+1 # been preserved, change to C+1:0:A+1
# c) If the interface is the same as the previous version, change to C:R+1:A # c) If the interface is the same as the previous version, change to C:R+1:A
LIBINPUT_LT_VERSION=19:1:9 LIBINPUT_LT_VERSION=19:4:9
AC_SUBST(LIBINPUT_LT_VERSION) AC_SUBST(LIBINPUT_LT_VERSION)
AM_SILENT_RULES([yes]) AM_SILENT_RULES([yes])

View file

@ -54,6 +54,52 @@ option is not exposed by the intermediary, it cannot be configured by the
client. Also some configuration options that are provided by the client. Also some configuration options that are provided by the
intermediary may not be libinput-specific configuration options. intermediary may not be libinput-specific configuration options.
@section faq_configure_wayland How do I configure my device on Wayland?
See @ref faq_config_options Use the configuration tool provided by your
desktop environment (e.g. gnome-control-center) or direct access to your
desktop environment's configuration storage (e.g. gsettings).
@section faq_configure_xorg How do I configure my device on X?
See @ref faq_config_options If your desktop environment does not provide a
graphical configuration tool you can use an
<a href="https://www.x.org/archive/current/doc/man/man5/xorg.conf.5.xhtml">xorg.conf.d snippet</a>.
Usually, such a snippet looks like this:
<pre>
$> cat /etc/X11/xorg.conf.d/99-libinput-custom-config.conf
Section "InputClass"
Identifier "something to identify this snippet"
MatchDriver "libinput"
MatchProduct "substring of the device name"
Option "some option name" "the option value"
EndSection
</pre>
The identifier is merely a human-readable string that shows up in the log
file. The MatchProduct line should contain the device name or a substring of
the device name that the snippet should apply to. For a full list of option
names and permitted values, see the
<a href="https://www.mankier.com/4/libinput">libinput man page</a>.
xorg.conf.d snippets like the above apply to hotplugged devices but can be
overwritten at runtime by desktop tools. Multiple snippets may be placed
into the same file.
For run-time configuration and testing, the
<a href="https://www.x.org/archive/X11R7.5/doc/man/man1/xinput.1.html">xinput</a>
debugging tool can modify a devices' properties. See the
<a href="https://www.mankier.com/4/libinput">libinput man page</a>
for supported property names and values. Usually, an invocation looks like
this:
<pre>
$> xinput set-prop "the device name" "the property name" value [value2] [value3]
</pre>
@note
Changes performed by xinput do not persist across device hotplugs. xinput is
considered a debugging and testing tool only and should not be used for
permanent configurations.
@section faq_hwdb_changes How to apply hwdb changes @section faq_hwdb_changes How to apply hwdb changes
Sometimes users are asked to test updates to the <a Sometimes users are asked to test updates to the <a
@ -74,7 +120,7 @@ commands below.
Rebuild the hwdb and load the new set on your device: Rebuild the hwdb and load the new set on your device:
sudo udevadm hwdb --reload sudo udevadm hwdb --update
sudo udevadm trigger /sys/class/input/eventX sudo udevadm trigger /sys/class/input/eventX
sudo udevadm test /sys/class/input/eventX sudo udevadm test /sys/class/input/eventX

View file

@ -15,6 +15,7 @@ IMAGE_PATH = @top_srcdir@/doc/svg \
GENERATE_HTML = YES GENERATE_HTML = YES
HTML_TIMESTAMP = YES HTML_TIMESTAMP = YES
USE_MATHJAX = YES USE_MATHJAX = YES
MATHJAX_RELPATH = https://cdn.mathjax.org/mathjax/latest
GENERATE_LATEX = NO GENERATE_LATEX = NO
MACRO_EXPANSION = YES MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES EXPAND_ONLY_PREDEF = YES

View file

@ -339,6 +339,9 @@ tp_edge_scroll_handle_state(struct tp_dispatch *tp, uint64_t time)
if (t->state == TOUCH_BEGIN) if (t->state == TOUCH_BEGIN)
t->scroll.edge_state = t->scroll.edge_state =
EDGE_SCROLL_TOUCH_STATE_AREA; EDGE_SCROLL_TOUCH_STATE_AREA;
else if (t->state == TOUCH_END)
t->scroll.edge_state =
EDGE_SCROLL_TOUCH_STATE_NONE;
} }
return; return;
} }

View file

@ -955,8 +955,11 @@ tp_need_motion_history_reset(struct tp_dispatch *tp)
{ {
bool rc = false; bool rc = false;
/* semi-mt finger postions may "jump" when nfingers changes */ /* Changing the numbers of fingers can cause a jump in the
if (tp->semi_mt && tp->nfingers_down != tp->old_nfingers_down) * coordinates, always reset the motion history for all touches when
* that happens.
*/
if (tp->nfingers_down != tp->old_nfingers_down)
return true; return true;
/* if we're transitioning between slots and fake touches in either /* if we're transitioning between slots and fake touches in either
@ -1295,6 +1298,7 @@ tp_trackpoint_timeout(uint64_t now, void *data)
tp_tap_resume(tp, now); tp_tap_resume(tp, now);
tp->palm.trackpoint_active = false; tp->palm.trackpoint_active = false;
tp->palm.trackpoint_event_count = 0;
} }
static void static void
@ -1307,6 +1311,13 @@ tp_trackpoint_event(uint64_t time, struct libinput_event *event, void *data)
if (event->type == LIBINPUT_EVENT_POINTER_BUTTON) if (event->type == LIBINPUT_EVENT_POINTER_BUTTON)
return; return;
tp->palm.trackpoint_last_event_time = time;
tp->palm.trackpoint_event_count++;
/* Require at least three events before enabling palm detection */
if (tp->palm.trackpoint_event_count < 3)
return;
if (!tp->palm.trackpoint_active) { if (!tp->palm.trackpoint_active) {
tp_edge_scroll_stop_events(tp, time); tp_edge_scroll_stop_events(tp, time);
tp_gesture_cancel(tp, time); tp_gesture_cancel(tp, time);
@ -1314,7 +1325,6 @@ tp_trackpoint_event(uint64_t time, struct libinput_event *event, void *data)
tp->palm.trackpoint_active = true; tp->palm.trackpoint_active = true;
} }
tp->palm.trackpoint_last_event_time = time;
libinput_timer_set(&tp->palm.trackpoint_timer, libinput_timer_set(&tp->palm.trackpoint_timer,
time + DEFAULT_TRACKPOINT_ACTIVITY_TIMEOUT); time + DEFAULT_TRACKPOINT_ACTIVITY_TIMEOUT);
} }
@ -1589,6 +1599,24 @@ evdev_tag_touchpad(struct evdev_device *device,
struct udev_device *udev_device) struct udev_device *udev_device)
{ {
int bustype, vendor; int bustype, vendor;
const char *prop;
prop = udev_device_get_property_value(udev_device,
"ID_INPUT_TOUCHPAD_INTEGRATION");
if (prop) {
if (streq(prop, "internal")) {
evdev_tag_touchpad_internal(device);
return;
} else if (streq(prop, "external")) {
evdev_tag_touchpad_external(device);
return;
} else {
log_info(evdev_libinput_context(device),
"%s: tagged as unknown value %s\n",
device->devname,
prop);
}
}
/* simple approach: touchpads on USB or Bluetooth are considered /* simple approach: touchpads on USB or Bluetooth are considered
* external, anything else is internal. Exception is Apple - * external, anything else is internal. Exception is Apple -

View file

@ -334,6 +334,7 @@ struct tp_dispatch {
struct libinput_event_listener trackpoint_listener; struct libinput_event_listener trackpoint_listener;
struct libinput_timer trackpoint_timer; struct libinput_timer trackpoint_timer;
uint64_t trackpoint_last_event_time; uint64_t trackpoint_last_event_time;
uint32_t trackpoint_event_count;
bool monitor_trackpoint; bool monitor_trackpoint;
} palm; } palm;

View file

@ -899,13 +899,12 @@ tablet_get_tool(struct tablet_dispatch *tablet,
uint32_t tool_id, uint32_t tool_id,
uint32_t serial) uint32_t serial)
{ {
struct libinput *libinput = tablet_libinput_context(tablet);
struct libinput_tablet_tool *tool = NULL, *t; struct libinput_tablet_tool *tool = NULL, *t;
struct list *tool_list; struct list *tool_list;
if (serial) { if (serial) {
struct libinput *libinput = tablet_libinput_context(tablet);
tool_list = &libinput->tool_list; tool_list = &libinput->tool_list;
/* Check if we already have the tool in our list of tools */ /* Check if we already have the tool in our list of tools */
list_for_each(t, tool_list, link) { list_for_each(t, tool_list, link) {
if (type == t->type && serial == t->serial) { if (type == t->type && serial == t->serial) {
@ -913,20 +912,32 @@ tablet_get_tool(struct tablet_dispatch *tablet,
break; break;
} }
} }
} else { }
/* If we get a tool with a delayed serial number, we already created
* a 0-serial number tool for it earlier. Re-use that, even though
* it means we can't distinguish this tool from others.
* https://bugs.freedesktop.org/show_bug.cgi?id=97526
*/
if (!tool) {
tool_list = &tablet->tool_list;
/* We can't guarantee that tools without serial numbers are /* We can't guarantee that tools without serial numbers are
* unique, so we keep them local to the tablet that they come * unique, so we keep them local to the tablet that they come
* into proximity of instead of storing them in the global tool * into proximity of instead of storing them in the global tool
* list */ * list
tool_list = &tablet->tool_list; * Same as above, but don't bother checking the serial number
*/
/* Same as above, but don't bother checking the serial number */
list_for_each(t, tool_list, link) { list_for_each(t, tool_list, link) {
if (type == t->type) { if (type == t->type) {
tool = t; tool = t;
break; break;
} }
} }
/* Didn't find the tool but we have a serial. Switch
* tool_list back so we create in the correct list */
if (!tool && serial)
tool_list = &libinput->tool_list;
} }
/* If we didn't already have the new_tool in our list of tools, /* If we didn't already have the new_tool in our list of tools,

View file

@ -1803,10 +1803,12 @@ evdev_read_model_flags(struct evdev_device *device)
MODEL(APPLE_INTERNAL_KEYBOARD), MODEL(APPLE_INTERNAL_KEYBOARD),
MODEL(CYBORG_RAT), MODEL(CYBORG_RAT),
MODEL(CYAPA), MODEL(CYAPA),
MODEL(HP_STREAM11_TOUCHPAD),
MODEL(LENOVO_T450_TOUCHPAD), MODEL(LENOVO_T450_TOUCHPAD),
MODEL(DELL_TOUCHPAD), MODEL(DELL_TOUCHPAD),
MODEL(TRACKBALL), MODEL(TRACKBALL),
MODEL(APPLE_MAGICMOUSE), MODEL(APPLE_MAGICMOUSE),
MODEL(HP8510_TOUCHPAD),
{ NULL, EVDEV_MODEL_DEFAULT }, { NULL, EVDEV_MODEL_DEFAULT },
#undef MODEL #undef MODEL
}; };
@ -2430,6 +2432,20 @@ evdev_pre_configure_model_quirks(struct evdev_device *device)
*/ */
if (device->model_flags & EVDEV_MODEL_APPLE_MAGICMOUSE) if (device->model_flags & EVDEV_MODEL_APPLE_MAGICMOUSE)
libevdev_disable_event_type(device->evdev, EV_ABS); libevdev_disable_event_type(device->evdev, EV_ABS);
/* Claims to have double/tripletap but doesn't actually send it
* https://bugzilla.redhat.com/show_bug.cgi?id=1351285
*/
if (device->model_flags & EVDEV_MODEL_HP8510_TOUCHPAD) {
libevdev_disable_event_code(device->evdev, EV_KEY, BTN_TOOL_DOUBLETAP);
libevdev_disable_event_code(device->evdev, EV_KEY, BTN_TOOL_TRIPLETAP);
}
/* Touchpad is a clickpad but INPUT_PROP_BUTTONPAD is not set, see
* fdo bug 97147. Remove when RMI4 is commonplace */
if (device->model_flags & EVDEV_MODEL_HP_STREAM11_TOUCHPAD)
libevdev_enable_property(device->evdev,
INPUT_PROP_BUTTONPAD);
} }
struct evdev_device * struct evdev_device *
@ -3038,7 +3054,9 @@ evdev_tablet_has_left_handed(struct evdev_device *device)
if (libwacom_is_reversible(d)) if (libwacom_is_reversible(d))
has_left_handed = true; has_left_handed = true;
} else if (libwacom_error_get_code(error) == WERROR_UNKNOWN_MODEL) { } else if (libwacom_error_get_code(error) == WERROR_UNKNOWN_MODEL) {
log_info(libinput, "Tablet unknown to libwacom\n"); log_info(libinput,
"%s: tablet unknown to libwacom\n",
device->devname);
} else { } else {
log_error(libinput, log_error(libinput,
"libwacom error: %s\n", "libwacom error: %s\n",

View file

@ -114,10 +114,12 @@ enum evdev_device_model {
EVDEV_MODEL_APPLE_INTERNAL_KEYBOARD = (1 << 13), EVDEV_MODEL_APPLE_INTERNAL_KEYBOARD = (1 << 13),
EVDEV_MODEL_CYBORG_RAT = (1 << 14), EVDEV_MODEL_CYBORG_RAT = (1 << 14),
EVDEV_MODEL_CYAPA = (1 << 15), EVDEV_MODEL_CYAPA = (1 << 15),
EVDEV_MODEL_HP_STREAM11_TOUCHPAD = (1 << 16),
EVDEV_MODEL_LENOVO_T450_TOUCHPAD= (1 << 17), EVDEV_MODEL_LENOVO_T450_TOUCHPAD= (1 << 17),
EVDEV_MODEL_DELL_TOUCHPAD = (1 << 18), EVDEV_MODEL_DELL_TOUCHPAD = (1 << 18),
EVDEV_MODEL_TRACKBALL = (1 << 19), EVDEV_MODEL_TRACKBALL = (1 << 19),
EVDEV_MODEL_APPLE_MAGICMOUSE = (1 << 20), EVDEV_MODEL_APPLE_MAGICMOUSE = (1 << 20),
EVDEV_MODEL_HP8510_TOUCHPAD = (1 << 21),
}; };
struct mt_slot { struct mt_slot {

View file

@ -55,6 +55,7 @@ liblitest_la_SOURCES = \
litest-device-wacom-cintiq-24hd.c \ litest-device-wacom-cintiq-24hd.c \
litest-device-wacom-cintiq-24hdt-pad.c \ litest-device-wacom-cintiq-24hdt-pad.c \
litest-device-wacom-ekr.c \ litest-device-wacom-ekr.c \
litest-device-wacom-hid4800-pen.c \
litest-device-wacom-intuos-tablet.c \ litest-device-wacom-intuos-tablet.c \
litest-device-wacom-intuos3-pad.c \ litest-device-wacom-intuos3-pad.c \
litest-device-wacom-intuos5-pad.c \ litest-device-wacom-intuos5-pad.c \
@ -211,6 +212,8 @@ valgrind: all
check: valgrind check: valgrind
DISTCLEANFILES=test-suite-valgrind.log
endif endif
endif endif
EXTRA_DIST=valgrind.suppressions EXTRA_DIST=valgrind.suppressions

View file

@ -0,0 +1,119 @@
/*
* Copyright © 2016 Red Hat, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that copyright
* notice and this permission notice appear in supporting documentation, and
* that the name of the copyright holders not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no representations
* about the suitability of this software for any purpose. It is provided "as
* is" without express or implied warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
#include "litest.h"
#include "litest-int.h"
static void litest_wacom_hid4800_tablet_setup(void)
{
struct litest_device *d = litest_create_device(LITEST_WACOM_HID4800_PEN);
litest_set_current_device(d);
}
static struct input_event proximity_in[] = {
{ .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_ABS, .code = ABS_PRESSURE, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_KEY, .code = BTN_TOOL_PEN, .value = 1 },
{ .type = EV_MSC, .code = MSC_SERIAL, .value = 297797542 },
{ .type = EV_SYN, .code = SYN_REPORT, .value = 0 },
{ .type = -1, .code = -1 },
};
static struct input_event proximity_out[] = {
{ .type = EV_ABS, .code = ABS_X, .value = 0 },
{ .type = EV_ABS, .code = ABS_Y, .value = 0 },
{ .type = EV_MSC, .code = MSC_SERIAL, .value = 0 },
{ .type = EV_KEY, .code = BTN_TOOL_PEN, .value = 0 },
{ .type = EV_SYN, .code = SYN_REPORT, .value = 0 },
{ .type = -1, .code = -1 },
};
static struct input_event motion[] = {
{ .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_ABS, .code = ABS_PRESSURE, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_MSC, .code = MSC_SERIAL, .value = 297797542 },
{ .type = EV_SYN, .code = SYN_REPORT, .value = 0 },
{ .type = -1, .code = -1 },
};
static int
get_axis_default(struct litest_device *d, unsigned int evcode, int32_t *value)
{
switch (evcode) {
case ABS_PRESSURE:
*value = 100;
return 0;
}
return 1;
}
static struct litest_device_interface interface = {
.tablet_proximity_in_events = proximity_in,
.tablet_proximity_out_events = proximity_out,
.tablet_motion_events = motion,
.get_axis_default = get_axis_default,
};
static struct input_absinfo absinfo[] = {
{ ABS_X, 0, 21696, 4, 0, 100 },
{ ABS_Y, 0, 13560, 4, 0, 100 },
{ ABS_PRESSURE, 0, 2047, 0, 0, 0 },
{ .value = -1 },
};
static struct input_id input_id = {
.bustype = 0x18,
.vendor = 0x56a,
.product = 0x4800,
.version = 0x100,
};
static int events[] = {
EV_KEY, BTN_TOOL_PEN,
EV_KEY, BTN_TOOL_RUBBER,
EV_KEY, BTN_TOUCH,
EV_KEY, BTN_STYLUS,
EV_KEY, BTN_STYLUS2,
EV_MSC, MSC_SERIAL,
INPUT_PROP_MAX, INPUT_PROP_DIRECT,
-1, -1,
};
struct litest_test_device litest_wacom_hid4800_tablet_device = {
.type = LITEST_WACOM_HID4800_PEN,
.features = LITEST_TABLET,
.shortname = "wacom-hid4800-tablet",
.setup = litest_wacom_hid4800_tablet_setup,
.interface = &interface,
.name = "Wacom HID 4800 Pen",
.id = &input_id,
.events = events,
.absinfo = absinfo,
};

View file

@ -389,6 +389,7 @@ extern struct litest_test_device litest_wacom_cintiq_24hdt_pad_device;
extern struct litest_test_device litest_wacom_cintiq_13hdt_finger_device; extern struct litest_test_device litest_wacom_cintiq_13hdt_finger_device;
extern struct litest_test_device litest_wacom_cintiq_13hdt_pen_device; extern struct litest_test_device litest_wacom_cintiq_13hdt_pen_device;
extern struct litest_test_device litest_wacom_cintiq_13hdt_pad_device; extern struct litest_test_device litest_wacom_cintiq_13hdt_pad_device;
extern struct litest_test_device litest_wacom_hid4800_tablet_device;
struct litest_test_device* devices[] = { struct litest_test_device* devices[] = {
&litest_synaptics_clickpad_device, &litest_synaptics_clickpad_device,
@ -444,6 +445,7 @@ struct litest_test_device* devices[] = {
&litest_wacom_cintiq_13hdt_finger_device, &litest_wacom_cintiq_13hdt_finger_device,
&litest_wacom_cintiq_13hdt_pen_device, &litest_wacom_cintiq_13hdt_pen_device,
&litest_wacom_cintiq_13hdt_pad_device, &litest_wacom_cintiq_13hdt_pad_device,
&litest_wacom_hid4800_tablet_device,
NULL, NULL,
}; };
@ -2873,6 +2875,12 @@ litest_timeout_gesture(void)
msleep(120); msleep(120);
} }
void
litest_timeout_trackpoint(void)
{
msleep(320);
}
void void
litest_push_event_frame(struct litest_device *dev) litest_push_event_frame(struct litest_device *dev)
{ {

View file

@ -206,6 +206,7 @@ enum litest_device_type {
LITEST_WACOM_CINTIQ_13HDT_PEN, LITEST_WACOM_CINTIQ_13HDT_PEN,
LITEST_WACOM_CINTIQ_13HDT_PAD, LITEST_WACOM_CINTIQ_13HDT_PAD,
LITEST_WACOM_CINTIQ_13HDT_FINGER, LITEST_WACOM_CINTIQ_13HDT_FINGER,
LITEST_WACOM_HID4800_PEN,
}; };
enum litest_device_feature { enum litest_device_feature {
@ -631,6 +632,9 @@ litest_timeout_dwt_long(void);
void void
litest_timeout_gesture(void); litest_timeout_gesture(void);
void
litest_timeout_trackpoint(void);
void void
litest_push_event_frame(struct litest_device *dev); litest_push_event_frame(struct litest_device *dev);

View file

@ -2158,6 +2158,93 @@ START_TEST(tools_without_serials)
} }
END_TEST END_TEST
START_TEST(tool_delayed_serial)
{
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
struct libinput_event *event;
struct libinput_event_tablet_tool *tev;
struct libinput_tablet_tool *tool;
unsigned int serial;
litest_drain_events(li);
litest_event(dev, EV_ABS, ABS_X, 4500);
litest_event(dev, EV_ABS, ABS_Y, 2000);
litest_event(dev, EV_MSC, MSC_SERIAL, 0);
litest_event(dev, EV_KEY, BTN_TOOL_PEN, 1);
litest_event(dev, EV_SYN, SYN_REPORT, 0);
libinput_dispatch(li);
event = libinput_get_event(li);
tev = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY);
tool = libinput_event_tablet_tool_get_tool(tev);
serial = libinput_tablet_tool_get_serial(tool);
ck_assert_int_eq(serial, 0);
libinput_event_destroy(event);
for (int x = 4500; x < 8000; x += 1000) {
litest_event(dev, EV_ABS, ABS_X, x);
litest_event(dev, EV_ABS, ABS_Y, 2000);
litest_event(dev, EV_MSC, MSC_SERIAL, 0);
litest_event(dev, EV_SYN, SYN_REPORT, 0);
libinput_dispatch(li);
}
litest_drain_events(li);
/* Now send the serial */
litest_event(dev, EV_ABS, ABS_X, 4500);
litest_event(dev, EV_ABS, ABS_Y, 2000);
litest_event(dev, EV_MSC, MSC_SERIAL, 1234566);
litest_event(dev, EV_SYN, SYN_REPORT, 0);
libinput_dispatch(li);
event = libinput_get_event(li);
tev = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_AXIS);
tool = libinput_event_tablet_tool_get_tool(tev);
serial = libinput_tablet_tool_get_serial(tool);
ck_assert_int_eq(serial, 0);
libinput_event_destroy(event);
for (int x = 4500; x < 8000; x += 500) {
litest_event(dev, EV_ABS, ABS_X, x);
litest_event(dev, EV_ABS, ABS_Y, 2000);
litest_event(dev, EV_MSC, MSC_SERIAL, 1234566);
litest_event(dev, EV_SYN, SYN_REPORT, 0);
libinput_dispatch(li);
}
event = libinput_get_event(li);
do {
tev = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_AXIS);
tool = libinput_event_tablet_tool_get_tool(tev);
serial = libinput_tablet_tool_get_serial(tool);
ck_assert_int_eq(serial, 0);
libinput_event_destroy(event);
event = libinput_get_event(li);
} while (event != NULL);
/* Quirk: tool out event is a serial of 0 */
litest_event(dev, EV_ABS, ABS_X, 4500);
litest_event(dev, EV_ABS, ABS_Y, 2000);
litest_event(dev, EV_MSC, MSC_SERIAL, 0);
litest_event(dev, EV_KEY, BTN_TOOL_PEN, 0);
litest_event(dev, EV_SYN, SYN_REPORT, 0);
libinput_dispatch(li);
event = libinput_get_event(li);
tev = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY);
tool = libinput_event_tablet_tool_get_tool(tev);
serial = libinput_tablet_tool_get_serial(tool);
ck_assert_int_eq(serial, 0);
libinput_event_destroy(event);
}
END_TEST
START_TEST(tool_capabilities) START_TEST(tool_capabilities)
{ {
struct libinput *li = litest_create_context(); struct libinput *li = litest_create_context();
@ -3687,6 +3774,7 @@ litest_setup_tests(void)
litest_add("tablet:tool_serial", invalid_serials, LITEST_TABLET | LITEST_TOOL_SERIAL, LITEST_ANY); litest_add("tablet:tool_serial", invalid_serials, LITEST_TABLET | LITEST_TOOL_SERIAL, LITEST_ANY);
litest_add_no_device("tablet:tool_serial", tools_with_serials); litest_add_no_device("tablet:tool_serial", tools_with_serials);
litest_add_no_device("tablet:tool_serial", tools_without_serials); litest_add_no_device("tablet:tool_serial", tools_without_serials);
litest_add_for_device("tablet:tool_serial", tool_delayed_serial, LITEST_WACOM_HID4800_PEN);
litest_add("tablet:proximity", proximity_out_clear_buttons, LITEST_TABLET, LITEST_ANY); litest_add("tablet:proximity", proximity_out_clear_buttons, LITEST_TABLET, LITEST_ANY);
litest_add("tablet:proximity", proximity_in_out, LITEST_TABLET, LITEST_ANY); litest_add("tablet:proximity", proximity_in_out, LITEST_TABLET, LITEST_ANY);
litest_add("tablet:proximity", proximity_in_button_down, LITEST_TABLET, LITEST_ANY); litest_add("tablet:proximity", proximity_in_button_down, LITEST_TABLET, LITEST_ANY);

View file

@ -607,7 +607,7 @@ START_TEST(touchpad_1fg_tap_n_drag)
litest_touch_down(dev, 0, 50, 50); litest_touch_down(dev, 0, 50, 50);
litest_touch_up(dev, 0); litest_touch_up(dev, 0);
litest_touch_down(dev, 0, 50, 50); litest_touch_down(dev, 0, 50, 50);
litest_touch_move_to(dev, 0, 50, 50, 80, 80, 5, 40); litest_touch_move_to(dev, 0, 50, 50, 80, 80, 20, 2);
libinput_dispatch(li); libinput_dispatch(li);
@ -649,7 +649,7 @@ START_TEST(touchpad_1fg_tap_n_drag_draglock)
litest_touch_down(dev, 0, 50, 50); litest_touch_down(dev, 0, 50, 50);
litest_touch_up(dev, 0); litest_touch_up(dev, 0);
litest_touch_down(dev, 0, 50, 50); litest_touch_down(dev, 0, 50, 50);
litest_touch_move_to(dev, 0, 50, 50, 80, 80, 5, 40); litest_touch_move_to(dev, 0, 50, 50, 80, 80, 20, 2);
litest_touch_up(dev, 0); litest_touch_up(dev, 0);
libinput_dispatch(li); libinput_dispatch(li);
@ -663,7 +663,7 @@ START_TEST(touchpad_1fg_tap_n_drag_draglock)
/* lift finger, set down again, should continue dragging */ /* lift finger, set down again, should continue dragging */
litest_touch_down(dev, 0, 50, 50); litest_touch_down(dev, 0, 50, 50);
litest_touch_move_to(dev, 0, 50, 50, 80, 80, 5, 40); litest_touch_move_to(dev, 0, 50, 50, 80, 80, 20, 2);
litest_touch_up(dev, 0); litest_touch_up(dev, 0);
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION); litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
@ -690,7 +690,7 @@ START_TEST(touchpad_1fg_tap_n_drag_draglock_tap)
litest_touch_down(dev, 0, 50, 50); litest_touch_down(dev, 0, 50, 50);
litest_touch_up(dev, 0); litest_touch_up(dev, 0);
litest_touch_down(dev, 0, 50, 50); litest_touch_down(dev, 0, 50, 50);
litest_touch_move_to(dev, 0, 50, 50, 80, 80, 5, 40); litest_touch_move_to(dev, 0, 50, 50, 80, 80, 20, 2);
litest_touch_up(dev, 0); litest_touch_up(dev, 0);
libinput_dispatch(li); libinput_dispatch(li);
@ -704,7 +704,7 @@ START_TEST(touchpad_1fg_tap_n_drag_draglock_tap)
/* lift finger, set down again, should continue dragging */ /* lift finger, set down again, should continue dragging */
litest_touch_down(dev, 0, 50, 50); litest_touch_down(dev, 0, 50, 50);
litest_touch_move_to(dev, 0, 50, 50, 80, 80, 5, 40); litest_touch_move_to(dev, 0, 50, 50, 80, 80, 20, 2);
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION); litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
@ -732,7 +732,7 @@ START_TEST(touchpad_1fg_tap_n_drag_draglock_tap_click)
litest_touch_down(dev, 0, 50, 50); litest_touch_down(dev, 0, 50, 50);
litest_touch_up(dev, 0); litest_touch_up(dev, 0);
litest_touch_down(dev, 0, 50, 50); litest_touch_down(dev, 0, 50, 50);
litest_touch_move_to(dev, 0, 50, 50, 80, 80, 5, 40); litest_touch_move_to(dev, 0, 50, 50, 80, 80, 20, 2);
libinput_dispatch(li); libinput_dispatch(li);
litest_assert_button_event(li, BTN_LEFT, litest_assert_button_event(li, BTN_LEFT,

View file

@ -429,6 +429,10 @@ START_TEST(touchpad_edge_scroll_vert)
struct litest_device *dev = litest_current_device(); struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput; struct libinput *li = dev->libinput;
litest_touch_down(dev, 0, 99, 20);
litest_touch_move_to(dev, 0, 99, 20, 99, 80, 10, 0);
litest_touch_up(dev, 0);
litest_drain_events(li); litest_drain_events(li);
litest_enable_edge_scroll(dev); litest_enable_edge_scroll(dev);
@ -466,6 +470,10 @@ START_TEST(touchpad_edge_scroll_horiz)
struct litest_device *dev = litest_current_device(); struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput; struct libinput *li = dev->libinput;
litest_touch_down(dev, 0, 99, 20);
litest_touch_move_to(dev, 0, 99, 20, 99, 80, 10, 0);
litest_touch_up(dev, 0);
if (!touchpad_has_horiz_edge_scroll_size(dev)) if (!touchpad_has_horiz_edge_scroll_size(dev))
return; return;
@ -4064,6 +4072,56 @@ START_TEST(touchpad_tool_tripletap_touch_count)
} }
END_TEST END_TEST
START_TEST(touchpad_slot_swap)
{
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
struct libinput_event *event;
struct libinput_event_pointer *ptrev;
int first, second;
/* Synaptics touchpads sometimes end the wrong touchpoint on finger
* up, causing the remaining slot to continue with the other slot's
* coordinates.
* https://bugs.freedesktop.org/show_bug.cgi?id=91352
*/
litest_drain_events(li);
for (first = 0; first <= 1; first++) {
second = 1 - first;
litest_touch_down(dev, 0, 50, 50);
libinput_dispatch(li);
litest_touch_down(dev, 1, 70, 70);
libinput_dispatch(li);
litest_touch_move_to(dev, first, 50, 50, 50, 30, 10, 1);
litest_drain_events(li);
/* release touch 0, continue other slot with 0's coords */
litest_push_event_frame(dev);
litest_touch_up(dev, first);
litest_touch_move(dev, second, 50, 30.1);
litest_pop_event_frame(dev);
libinput_dispatch(li);
litest_touch_move_to(dev, second, 50, 30, 50, 11, 10, 1);
libinput_dispatch(li);
event = libinput_get_event(li);
do {
ptrev = litest_is_motion_event(event);
ck_assert_double_eq(libinput_event_pointer_get_dx(ptrev), 0.0);
ck_assert_double_lt(libinput_event_pointer_get_dy(ptrev), 1.0);
libinput_event_destroy(event);
event = libinput_get_event(li);
} while (event);
litest_assert_empty_queue(li);
litest_touch_up(dev, second);
}
}
END_TEST
START_TEST(touchpad_time_usec) START_TEST(touchpad_time_usec)
{ {
struct litest_device *dev = litest_current_device(); struct litest_device *dev = litest_current_device();
@ -4257,6 +4315,7 @@ litest_setup_tests(void)
litest_add("touchpad:thumb", touchpad_thumb_tap_hold_2ndfg_tap, LITEST_CLICKPAD, LITEST_SINGLE_TOUCH); litest_add("touchpad:thumb", touchpad_thumb_tap_hold_2ndfg_tap, LITEST_CLICKPAD, LITEST_SINGLE_TOUCH);
litest_add_for_device("touchpad:bugs", touchpad_tool_tripletap_touch_count, LITEST_SYNAPTICS_TOPBUTTONPAD); litest_add_for_device("touchpad:bugs", touchpad_tool_tripletap_touch_count, LITEST_SYNAPTICS_TOPBUTTONPAD);
litest_add_for_device("touchpad:bugs", touchpad_slot_swap, LITEST_SYNAPTICS_TOPBUTTONPAD);
litest_add("touchpad:time", touchpad_time_usec, LITEST_TOUCHPAD, LITEST_ANY); litest_add("touchpad:time", touchpad_time_usec, LITEST_TOUCHPAD, LITEST_ANY);

View file

@ -280,6 +280,100 @@ START_TEST(trackpoint_topsoftbuttons_left_handed_both)
} }
END_TEST END_TEST
START_TEST(trackpoint_palmdetect)
{
struct litest_device *trackpoint = litest_current_device();
struct litest_device *touchpad;
struct libinput *li = trackpoint->libinput;
int i;
touchpad = litest_add_device(li, LITEST_SYNAPTICS_I2C);
litest_drain_events(li);
for (i = 0; i < 10; i++) {
litest_event(trackpoint, EV_REL, REL_X, 1);
litest_event(trackpoint, EV_REL, REL_Y, 1);
litest_event(trackpoint, EV_SYN, SYN_REPORT, 0);
libinput_dispatch(li);
}
litest_drain_events(li);
litest_touch_down(touchpad, 0, 30, 30);
litest_touch_move_to(touchpad, 0, 30, 30, 80, 80, 10, 1);
litest_touch_up(touchpad, 0);
litest_assert_empty_queue(li);
litest_timeout_trackpoint();
libinput_dispatch(li);
litest_touch_down(touchpad, 0, 30, 30);
litest_touch_move_to(touchpad, 0, 30, 30, 80, 80, 10, 1);
litest_touch_up(touchpad, 0);
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
litest_delete_device(touchpad);
}
END_TEST
START_TEST(trackpoint_palmdetect_resume_touch)
{
struct litest_device *trackpoint = litest_current_device();
struct litest_device *touchpad;
struct libinput *li = trackpoint->libinput;
int i;
touchpad = litest_add_device(li, LITEST_SYNAPTICS_I2C);
litest_drain_events(li);
for (i = 0; i < 10; i++) {
litest_event(trackpoint, EV_REL, REL_X, 1);
litest_event(trackpoint, EV_REL, REL_Y, 1);
litest_event(trackpoint, EV_SYN, SYN_REPORT, 0);
libinput_dispatch(li);
}
litest_drain_events(li);
litest_touch_down(touchpad, 0, 30, 30);
litest_touch_move_to(touchpad, 0, 30, 30, 80, 80, 10, 1);
litest_assert_empty_queue(li);
litest_timeout_trackpoint();
libinput_dispatch(li);
/* touch started after last tp event, expect resume */
litest_touch_move_to(touchpad, 0, 80, 80, 30, 30, 10, 1);
litest_touch_up(touchpad, 0);
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
litest_delete_device(touchpad);
}
END_TEST
START_TEST(trackpoint_palmdetect_require_min_events)
{
struct litest_device *trackpoint = litest_current_device();
struct litest_device *touchpad;
struct libinput *li = trackpoint->libinput;
touchpad = litest_add_device(li, LITEST_SYNAPTICS_I2C);
litest_drain_events(li);
/* A single event does not trigger palm detection */
litest_event(trackpoint, EV_REL, REL_X, 1);
litest_event(trackpoint, EV_REL, REL_Y, 1);
litest_event(trackpoint, EV_SYN, SYN_REPORT, 0);
libinput_dispatch(li);
litest_drain_events(li);
litest_touch_down(touchpad, 0, 30, 30);
litest_touch_move_to(touchpad, 0, 30, 30, 80, 80, 10, 1);
litest_touch_up(touchpad, 0);
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
litest_delete_device(touchpad);
}
END_TEST
void void
litest_setup_tests(void) litest_setup_tests(void)
{ {
@ -290,4 +384,8 @@ litest_setup_tests(void)
litest_add("trackpoint:left-handed", trackpoint_topsoftbuttons_left_handed_trackpoint, LITEST_TOPBUTTONPAD, LITEST_ANY); litest_add("trackpoint:left-handed", trackpoint_topsoftbuttons_left_handed_trackpoint, LITEST_TOPBUTTONPAD, LITEST_ANY);
litest_add("trackpoint:left-handed", trackpoint_topsoftbuttons_left_handed_touchpad, LITEST_TOPBUTTONPAD, LITEST_ANY); litest_add("trackpoint:left-handed", trackpoint_topsoftbuttons_left_handed_touchpad, LITEST_TOPBUTTONPAD, LITEST_ANY);
litest_add("trackpoint:left-handed", trackpoint_topsoftbuttons_left_handed_both, LITEST_TOPBUTTONPAD, LITEST_ANY); litest_add("trackpoint:left-handed", trackpoint_topsoftbuttons_left_handed_both, LITEST_TOPBUTTONPAD, LITEST_ANY);
litest_add("trackpoint:palmdetect", trackpoint_palmdetect, LITEST_POINTINGSTICK, LITEST_ANY);
litest_add("trackpoint:palmdetect", trackpoint_palmdetect_resume_touch, LITEST_POINTINGSTICK, LITEST_ANY);
litest_add("trackpoint:palmdetect", trackpoint_palmdetect_require_min_events, LITEST_POINTINGSTICK, LITEST_ANY);
} }

View file

@ -2,6 +2,7 @@ ACTION!="add|change", GOTO="libinput_device_group_end"
KERNEL!="event[0-9]*", GOTO="libinput_device_group_end" KERNEL!="event[0-9]*", GOTO="libinput_device_group_end"
ATTRS{phys}=="?*", \ ATTRS{phys}=="?*", \
ENV{LIBINPUT_DEVICE_GROUP}=="", \
PROGRAM="@UDEV_TEST_PATH@libinput-device-group %S%p", \ PROGRAM="@UDEV_TEST_PATH@libinput-device-group %S%p", \
ENV{LIBINPUT_DEVICE_GROUP}="%c" ENV{LIBINPUT_DEVICE_GROUP}="%c"

View file

@ -86,6 +86,18 @@ libinput:name:Atmel maXTouch Touchpad:dmi:*svn*GOOGLE*:pn*Samus*
libinput:name:Cypress APA Trackpad ?cyapa?:dmi:* libinput:name:Cypress APA Trackpad ?cyapa?:dmi:*
LIBINPUT_MODEL_CYAPA=1 LIBINPUT_MODEL_CYAPA=1
##########################################
# HP
##########################################
# HP 8510w
libinput:name:SynPS/2 Synaptics TouchPad:dmi:*svnHewlett-Packard:*pnHPCompaq8510w*
LIBINPUT_MODEL_HP8510_TOUCHPAD=1
# HP Stream 11
libinput:name:SYN1EDE:00 06CB:7442:dmi:*svnHewlett-Packard:pnHPStreamNotebookPC11*
LIBINPUT_MODEL_HP_STREAM11_TOUCHPAD=1
########################################## ##########################################
# LENOVO # LENOVO
########################################## ##########################################