...
 
Commits (56)
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -64,9 +64,6 @@ See @ref motion_normalization for details.
<dd>The angle in degrees for each click on a mouse wheel. See
libinput_pointer_get_axis_source() for details.
</dd>
<dt>POINTINGSTICK_CONST_ACCEL</dt>
<dd>A constant (linear) acceleration factor to apply to pointingstick deltas
to normalize them.
<dt>LIBINPUT_MODEL_*</dt>
<dd><b>This prefix is reserved as private API, do not use.</b> See @ref
model_specific_configuration for details.
......
......@@ -86,6 +86,12 @@ When you file a bug, please attach the following information:
most important piece of information, do not forget it!
- the vendor model number of the device (e.g. "Logitech M325")
- the output from udevadm info, see @ref udev_info.
- the output of `libinput measure trackpoint-range`
- the sensitivity of the trackpoint (adjust the event node number as needed):
@verbatim
$ cat /sys/class/input/event17/device/device/sensitivity
@endverbatim
@section reporting_bugs_other All other devices
......
project('libinput', 'c', 'cpp',
version : '1.10.0',
version : '1.10.7',
license : 'MIT/Expat',
default_options : [ 'c_std=gnu99', 'warning_level=2' ],
meson_version : '>= 0.40.0')
......@@ -234,7 +234,7 @@ pkgconfig.generate(
# Restore the SELinux context for the libinput.so.a.b.c on install
# meson bug https://github.com/mesonbuild/meson/issues/1967
meson.add_install_script('src/libinput-restore-selinux-context.sh',
get_option('libdir'),
join_paths(get_option('prefix'), get_option('libdir')),
lib_libinput.full_path())
############ documentation ############
......@@ -496,7 +496,8 @@ configure_file(input : 'tools/libinput.man',
install_dir : join_paths(get_option('mandir'), 'man1')
)
meson.add_install_script('tools/install-compat-scripts.sh')
meson.add_install_script('tools/install-compat-scripts.sh',
join_paths(get_option('prefix'), get_option('bindir')))
ptraccel_debug_sources = [ 'tools/ptraccel-debug.c' ]
executable('ptraccel-debug',
......@@ -522,7 +523,7 @@ if get_option('tests')
config_h.set10('HAVE_LIBUNWIND', dep_libunwind.found())
# for inhibit support during test run
dep_libsystemd = dependency('libsystemd', required : false)
dep_libsystemd = dependency('libsystemd', version : '>= 221', required : false)
config_h.set10('HAVE_LIBSYSTEMD', dep_libsystemd.found())
lib_litest_sources = [
......@@ -563,6 +564,7 @@ if get_option('tests')
'test/litest-device-mouse-low-dpi.c',
'test/litest-device-mouse-wheel-click-angle.c',
'test/litest-device-mouse-wheel-click-count.c',
'test/litest-device-ms-nano-transceiver-mouse.c',
'test/litest-device-ms-surface-cover.c',
'test/litest-device-protocol-a-touch-screen.c',
'test/litest-device-qemu-usb-tablet.c',
......
......@@ -83,6 +83,7 @@ debounce_state_to_str(enum debounce_state state)
CASE_RETURN_STRING(DEBOUNCE_STATE_MAYBE_SPURIOUS);
CASE_RETURN_STRING(DEBOUNCE_STATE_RELEASED);
CASE_RETURN_STRING(DEBOUNCE_STATE_PRESS_PENDING);
CASE_RETURN_STRING(DEBOUNCE_STATE_DISABLED);
}
return NULL;
......@@ -394,6 +395,31 @@ debounce_press_pending_event(struct fallback_dispatch *fallback, enum debounce_e
}
}
static void
debounce_disabled_event(struct fallback_dispatch *fallback,
enum debounce_event event,
uint64_t time)
{
switch (event) {
case DEBOUNCE_EVENT_PRESS:
fallback->debounce.button_time = time;
debounce_notify_button(fallback,
LIBINPUT_BUTTON_STATE_PRESSED);
break;
case DEBOUNCE_EVENT_RELEASE:
fallback->debounce.button_time = time;
debounce_notify_button(fallback,
LIBINPUT_BUTTON_STATE_RELEASED);
break;
case DEBOUNCE_EVENT_TIMEOUT_SHORT:
case DEBOUNCE_EVENT_TIMEOUT:
log_debounce_bug(fallback, event);
break;
case DEBOUNCE_EVENT_OTHERBUTTON:
break;
}
}
static void
debounce_handle_event(struct fallback_dispatch *fallback,
enum debounce_event event,
......@@ -434,6 +460,9 @@ debounce_handle_event(struct fallback_dispatch *fallback,
case DEBOUNCE_STATE_PRESS_PENDING:
debounce_press_pending_event(fallback, event, time);
break;
case DEBOUNCE_STATE_DISABLED:
debounce_disabled_event(fallback, event, time);
break;
}
evdev_log_debug(fallback->device,
......@@ -484,7 +513,8 @@ fallback_debounce_handle_state(struct fallback_dispatch *dispatch,
for (size_t i = 0; i < nchanged; i++) {
bool is_down = hw_is_key_down(dispatch, changed[i]);
if (flushed) {
if (flushed &&
dispatch->debounce.state != DEBOUNCE_STATE_DISABLED) {
debounce_set_state(dispatch,
!is_down ?
DEBOUNCE_STATE_IS_DOWN :
......@@ -538,6 +568,13 @@ fallback_init_debounce(struct fallback_dispatch *dispatch)
struct evdev_device *device = dispatch->device;
char timer_name[64];
if (device->model_flags &
(EVDEV_MODEL_MS_NANO_TRANSCEIVER|EVDEV_MODEL_LOGITECH_K400)) {
dispatch->debounce.state = DEBOUNCE_STATE_DISABLED;
return;
}
dispatch->debounce.state = DEBOUNCE_STATE_IS_UP;
snprintf(timer_name,
......
......@@ -127,12 +127,9 @@ fallback_filter_defuzz_touch(struct fallback_dispatch *dispatch,
if (!dispatch->mt.want_hysteresis)
return false;
point.x = evdev_hysteresis(slot->point.x,
slot->hysteresis_center.x,
dispatch->mt.hysteresis_margin.x);
point.y = evdev_hysteresis(slot->point.y,
slot->hysteresis_center.y,
dispatch->mt.hysteresis_margin.y);
point = evdev_hysteresis(&slot->point,
&slot->hysteresis_center,
&dispatch->mt.hysteresis_margin);
slot->hysteresis_center = slot->point;
if (point.x == slot->point.x && point.y == slot->point.y)
......@@ -1178,6 +1175,9 @@ fallback_keyboard_pair_tablet_mode(struct evdev_device *keyboard,
(EVDEV_TAG_TRACKPOINT|EVDEV_TAG_INTERNAL_KEYBOARD)) == 0)
return;
if (keyboard->model_flags & EVDEV_MODEL_TABLET_MODE_NO_SUSPEND)
return;
if ((tablet_mode_switch->tags & EVDEV_TAG_TABLET_MODE_SWITCH) == 0)
return;
......
......@@ -41,6 +41,8 @@ enum debounce_state {
DEBOUNCE_STATE_MAYBE_SPURIOUS,
DEBOUNCE_STATE_RELEASED,
DEBOUNCE_STATE_PRESS_PENDING,
DEBOUNCE_STATE_DISABLED = 999,
};
struct fallback_dispatch {
......
......@@ -362,6 +362,13 @@ tp_edge_scroll_handle_state(struct tp_dispatch *tp, uint64_t time)
case TOUCH_UPDATE:
tp_edge_scroll_handle_event(tp, t, SCROLL_EVENT_MOTION);
break;
case TOUCH_MAYBE_END:
/* This shouldn't happen we transfer to TOUCH_END
* before processing state */
evdev_log_debug(tp->device,
"touch unexpected state %d\n",
t->state);
/* fallthrough */
case TOUCH_END:
tp_edge_scroll_handle_event(tp, t, SCROLL_EVENT_RELEASE);
break;
......
......@@ -1025,10 +1025,14 @@ tp_tap_handle_state(struct tp_dispatch *tp, uint64_t time)
} else if (t->state == TOUCH_END) {
if (t->was_down) {
assert(tp->tap.nfingers_down >= 1);
tp->tap.nfingers_down--;
tp_tap_handle_event(tp, t, TAP_EVENT_RELEASE, time);
}
t->tap.state = TAP_TOUCH_STATE_IDLE;
} else if (tp->tap.state != TAP_STATE_IDLE &&
t->thumb.state == THUMB_STATE_YES) {
tp_tap_handle_event(tp, t, TAP_EVENT_THUMB, time);
} else if (tp->tap.state != TAP_STATE_IDLE &&
tp_tap_exceeds_motion_threshold(tp, t)) {
struct tp_touch *tmp;
......@@ -1041,10 +1045,6 @@ tp_tap_handle_state(struct tp_dispatch *tp, uint64_t time)
}
tp_tap_handle_event(tp, t, TAP_EVENT_MOTION, time);
} else if (tp->tap.state != TAP_STATE_IDLE &&
t->thumb.state == THUMB_STATE_YES &&
!t->tap.is_thumb) {
tp_tap_handle_event(tp, t, TAP_EVENT_THUMB, time);
}
}
......
This diff is collapsed.
......@@ -46,10 +46,11 @@ enum touchpad_event {
enum touch_state {
TOUCH_NONE = 0,
TOUCH_HOVERING,
TOUCH_BEGIN,
TOUCH_UPDATE,
TOUCH_END
TOUCH_HOVERING = 1,
TOUCH_BEGIN = 2,
TOUCH_UPDATE = 3,
TOUCH_MAYBE_END = 4,
TOUCH_END = 5,
};
enum touch_palm_state {
......@@ -147,6 +148,7 @@ struct tp_touch {
bool has_ended; /* TRACKING_ID == -1 */
bool dirty;
struct device_coords point;
struct device_coords last_point;
uint64_t time;
int pressure;
bool is_tool_palm; /* MT_TOOL_PALM */
......@@ -173,7 +175,10 @@ struct tp_touch {
unsigned int count;
} history;
struct device_coords hysteresis_center;
struct {
struct device_coords center;
uint8_t x_motion_history;
} hysteresis;
/* A pinned touchpoint is the one that pressed the physical button
* on a clickpad. After the release, it won't move until the center
......
......@@ -1169,8 +1169,7 @@ evdev_get_trackpoint_range(struct evdev_device *device)
prop = udev_device_get_property_value(device->udev_device,
"LIBINPUT_ATTR_TRACKPOINT_RANGE");
if (prop) {
if (!safe_atoi(prop, &range) ||
(range < 0.0 || range > 100)) {
if (!safe_atoi(prop, &range) || range < 0.0) {
evdev_log_error(device,
"trackpoint range property is present but invalid, "
"using %d instead\n",
......@@ -1180,6 +1179,12 @@ evdev_get_trackpoint_range(struct evdev_device *device)
goto out;
}
evdev_log_info(device,
"trackpoint does not have a specified range, "
"guessing... see %strackpoints.html\n",
HTTP_DOC_LINK);
prop = udev_device_get_property_value(device->udev_device,
"POINTINGSTICK_SENSITIVITY");
if (prop) {
......@@ -1251,6 +1256,7 @@ evdev_read_model_flags(struct evdev_device *device)
MODEL(ALPS_TOUCHPAD),
MODEL(SYNAPTICS_SERIAL_TOUCHPAD),
MODEL(JUMPING_SEMI_MT),
MODEL(LOGITECH_K400),
MODEL(CYBORG_RAT),
MODEL(HP_STREAM11_TOUCHPAD),
MODEL(LENOVO_T450_TOUCHPAD),
......@@ -1264,6 +1270,9 @@ evdev_read_model_flags(struct evdev_device *device)
MODEL(APPLE_TOUCHPAD_ONEBUTTON),
MODEL(LOGITECH_MARBLE_MOUSE),
MODEL(TABLET_NO_PROXIMITY_OUT),
MODEL(MS_NANO_TRANSCEIVER),
MODEL(TABLET_MODE_NO_SUSPEND),
MODEL(LENOVO_CARBON_X1_6TH),
#undef MODEL
{ "ID_INPUT_TRACKBALL", EVDEV_MODEL_TRACKBALL },
{ NULL, EVDEV_MODEL_DEFAULT },
......@@ -1860,6 +1869,13 @@ evdev_pre_configure_model_quirks(struct evdev_device *device)
/* Logitech Marble Mouse claims to have a middle button */
if (device->model_flags & EVDEV_MODEL_LOGITECH_MARBLE_MOUSE)
libevdev_disable_event_code(device->evdev, EV_KEY, BTN_MIDDLE);
/* Lenovo Carbon X1 6th gen sends bogus ABS_MT_TOOL_TYPE events for
* MT_TOOL_PALM */
if (device->model_flags & EVDEV_MODEL_LENOVO_CARBON_X1_6TH)
libevdev_disable_event_code(device->evdev,
EV_ABS,
ABS_MT_TOOL_TYPE);
}
static void
......@@ -1917,6 +1933,11 @@ evdev_device_create(struct libinput_seat *seat,
const char *devnode = udev_device_get_devnode(udev_device);
const char *sysname = udev_device_get_sysname(udev_device);
if (!devnode) {
log_info(libinput, "%s: no device node associated\n", sysname);
return NULL;
}
if (udev_device_should_be_ignored(udev_device)) {
log_debug(libinput, "%s: device is ignored\n", sysname);
return NULL;
......@@ -2434,6 +2455,9 @@ evdev_device_resume(struct evdev_device *device)
return -ENODEV;
devnode = udev_device_get_devnode(device->udev_device);
if (!devnode)
return -ENODEV;
fd = open_restricted(libinput, devnode,
O_RDWR | O_NONBLOCK | O_CLOEXEC);
......
......@@ -110,7 +110,9 @@ enum evdev_device_model {
EVDEV_MODEL_ALPS_TOUCHPAD = (1 << 8),
EVDEV_MODEL_SYNAPTICS_SERIAL_TOUCHPAD = (1 << 9),
EVDEV_MODEL_JUMPING_SEMI_MT = (1 << 10),
EVDEV_MODEL_LOGITECH_K400 = (1 << 11),
EVDEV_MODEL_LENOVO_X220_TOUCHPAD_FW81 = (1 << 12),
EVDEV_MODEL_LENOVO_CARBON_X1_6TH = (1 << 13),
EVDEV_MODEL_CYBORG_RAT = (1 << 14),
EVDEV_MODEL_HP_STREAM11_TOUCHPAD = (1 << 16),
EVDEV_MODEL_LENOVO_T450_TOUCHPAD= (1 << 17),
......@@ -124,6 +126,8 @@ enum evdev_device_model {
EVDEV_MODEL_APPLE_TOUCHPAD_ONEBUTTON = (1 << 25),
EVDEV_MODEL_LOGITECH_MARBLE_MOUSE = (1 << 26),
EVDEV_MODEL_TABLET_NO_PROXIMITY_OUT = (1 << 27),
EVDEV_MODEL_MS_NANO_TRANSCEIVER = (1 << 28),
EVDEV_MODEL_TABLET_MODE_NO_SUSPEND = (1 << 30),
};
enum evdev_button_scroll_state {
......@@ -599,11 +603,11 @@ evdev_to_left_handed(struct evdev_device *device,
* Apply a hysteresis filtering to the coordinate in, based on the current
* hysteresis center and the margin. If 'in' is within 'margin' of center,
* return the center (and thus filter the motion). If 'in' is outside,
* return a point on the edge of the new margin. So for a point x in the
* space outside c + margin we return r:
* +---+ +---+
* return a point on the edge of the new margin (which is an ellipse, usually
* a circle). So for a point x in the space outside c + margin we return r:
* ,---. ,---.
* | c | x → | r x
* +---+ +---+
* `---' `---'
*
* The effect of this is that initial small motions are filtered. Once we
* move into one direction we lag the real coordinates by 'margin' but any
......@@ -616,41 +620,71 @@ evdev_to_left_handed(struct evdev_device *device,
* Otherwise, the center has a dead zone of size margin around it and the
* first reachable point is the margin edge.
*
* Hysteresis is handled separately per axis (and the window is thus
* rectangular, not circular). It is unkown if that's an issue, but the
* calculation to do circular hysteresis are nontrivial, especially since
* many touchpads have uneven x/y resolutions.
*
* Given coordinates, 0, 1, 2, ... this is what we return for a margin of 3
* and a center of 0:
*
* Input: 1 2 3 4 5 6 5 4 3 2 1 0 -1
* Coord: 0 0 0 1 2 3 3 3 3 3 3 3 2
* Center: 0 0 0 1 2 3 3 3 3 3 3 3 2
*
* Problem: viewed from a stationary finger that starts moving, the
* hysteresis margin is M in both directions. Once we start moving
* continuously though, the margin is 0 in the movement direction and 2*M to
* change direction. That makes the finger less responsive to directional
* changes than to the original movement.
*
* @param in The input coordinate
* @param center Current center of the hysteresis
* @param margin Hysteresis width (on each side)
*
* @return The new center of the hysteresis
*/
static inline int
evdev_hysteresis(int in, int center, int margin)
static inline struct device_coords
evdev_hysteresis(const struct device_coords *in,
const struct device_coords *center,
const struct device_coords *margin)
{
int diff = in - center;
if (abs(diff) <= margin)
return center;
if (diff > 0)
return in - margin;
else
return in + margin;
int dx = in->x - center->x;
int dy = in->y - center->y;
int dx2 = dx * dx;
int dy2 = dy * dy;
int a = margin->x;
int b = margin->y;
double normalized_finger_distance, finger_distance, margin_distance;
double lag_x, lag_y;
struct device_coords result;
if (!a || !b)
return *in;
/*
* Basic equation for an ellipse of radii a,b:
* x²/a² + y²/b² = 1
* But we start by making a scaled ellipse passing through the
* relative finger location (dx,dy). So the scale of this ellipse is
* the ratio of finger_distance to margin_distance:
* dx²/a² + dy²/b² = normalized_finger_distance²
*/
normalized_finger_distance = sqrt((double)dx2 / (a * a) +
(double)dy2 / (b * b));
/* Which means anything less than 1 is within the elliptical margin */
if (normalized_finger_distance < 1.0)
return *center;
finger_distance = sqrt(dx2 + dy2);
margin_distance = finger_distance / normalized_finger_distance;
/*
* Now calculate the x,y coordinates on the edge of the margin ellipse
* where it intersects the finger vector. Shortcut: We achieve this by
* finding the point with the same gradient as dy/dx.
*/
if (dx) {
double gradient = (double)dy / dx;
lag_x = margin_distance / sqrt(gradient * gradient + 1);
lag_y = sqrt((margin_distance + lag_x) *
(margin_distance - lag_x));
} else { /* Infinite gradient */
lag_x = 0.0;
lag_y = margin_distance;
}
/*
* 'result' is the centre of an ellipse (radii a,b) which has been
* dragged by the finger moving inside it to 'in'. The finger is now
* touching the margin ellipse at some point: (±lag_x,±lag_y)
*/
result.x = (dx >= 0) ? in->x - lag_x : in->x + lag_x;
result.y = (dy >= 0) ? in->y - lag_y : in->y + lag_y;
return result;
}
static inline struct libinput *
......
......@@ -7,6 +7,6 @@ libdir="$1"
sofile=$(basename "$2")
if command -v restorecon >/dev/null; then
echo "Restoring SELinux context on $MESON_INSTALL_DESTDIR_PREFIX/$libdir/$sofile"
restorecon "$MESON_INSTALL_DESTDIR_PREFIX/$libdir/$sofile"
echo "Restoring SELinux context on ${DESTDIR}${libdir}/${sofile}"
restorecon "${DESTDIR}${libdir}/${sofile}"
fi
......@@ -425,9 +425,7 @@ parse_palm_pressure_property(const char *prop)
if (!prop)
return 0;
if (!safe_atoi(prop, &threshold) ||
threshold < 0 ||
threshold > 255) /* No touchpad device has pressure > 255 */
if (!safe_atoi(prop, &threshold) || threshold < 0)
return 0;
return threshold;
......
......@@ -4325,7 +4325,7 @@ libinput_device_config_calibration_get_matrix(struct libinput_device *device,
*
* @see libinput_device_config_calibration_has_matrix
* @see libinput_device_config_calibration_set_matrix
* @see libinput_device_config_calibration_get_default_matrix
* @see libinput_device_config_calibration_get_matrix
*/
int
libinput_device_config_calibration_get_default_matrix(struct libinput_device *device,
......
......@@ -150,6 +150,17 @@ udev_input_add_devices(struct udev_input *input, struct udev *udev)
continue;
}
/* Skip unconfigured device. udev will send an event
* when device is fully configured */
if (!udev_device_get_is_initialized(device)) {
log_debug(&input->base,
"%-7s - skip unconfigured input device '%s'\n",
sysname,
udev_device_get_devnode(device));
udev_device_unref(device);
continue;
}
if (device_added(device, input, NULL) < 0) {
udev_device_unref(device);
udev_enumerate_unref(e);
......@@ -229,7 +240,7 @@ udev_input_enable(struct libinput *libinput)
struct udev *udev = input->udev;
int fd;
if (input->udev_monitor)
if (input->udev_monitor || !input->seat_id)
return 0;
input->udev_monitor = udev_monitor_new_from_netlink(udev, "udev");
......
/*
* Copyright © 2018 Red Hat, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#include "config.h"
#include "litest.h"
#include "litest-int.h"
static struct input_id input_id = {
.bustype = 0x3,
.vendor = 0x045e,
.product = 0x0800,
};
static int events[] = {
EV_KEY, BTN_LEFT,
EV_KEY, BTN_RIGHT,
EV_KEY, BTN_MIDDLE,
EV_KEY, BTN_SIDE,
EV_KEY, BTN_EXTRA,
EV_REL, REL_X,
EV_REL, REL_Y,
EV_REL, REL_WHEEL,
EV_REL, REL_DIAL,
EV_REL, REL_HWHEEL,
-1 , -1,
};
TEST_DEVICE("ms-nano-mouse",
.type = LITEST_MS_NANO_TRANSCEIVER_MOUSE,
.features = LITEST_RELATIVE | LITEST_BUTTON | LITEST_WHEEL | LITEST_NO_DEBOUNCE,
.interface = NULL,
.name = "Microsoft Microsoft® Nano Transceiver v2.0",
.id = &input_id,
.absinfo = NULL,
.events = events,
)
......@@ -270,6 +270,7 @@ enum litest_device_type {
LITEST_WACOM_BAMBOO_2FG_PEN,
LITEST_WACOM_BAMBOO_2FG_FINGER,
LITEST_HP_WMI_HOTKEYS,
LITEST_MS_NANO_TRANSCEIVER_MOUSE,
};
enum litest_device_feature {
......@@ -303,6 +304,7 @@ enum litest_device_feature {
LITEST_LEDS = 1 << 25,
LITEST_SWITCH = 1 << 26,
LITEST_IGNORED = 1 << 27,
LITEST_NO_DEBOUNCE = 1 << 28,
};
/* this is a semi-mt device, so we keep track of the touches that the tests
......
......@@ -1055,16 +1055,15 @@ START_TEST(palm_pressure_parser)
{ "1", 1 },
{ "10", 10 },
{ "255", 255 },
{ "360", 360 },
{ "-12", 0 },
{ "360", 0 },
{ "0", 0 },
{ "-0", 0 },
{ "a", 0 },
{ "10a", 0 },
{ "10-", 0 },
{ "sadfasfd", 0 },
{ "361", 0 },
{ NULL, 0 }
};
......
......@@ -2602,11 +2602,11 @@ litest_setup_tests_pointer(void)
litest_add("pointer:time", pointer_time_usec, LITEST_RELATIVE, LITEST_ANY);
litest_add_ranged("pointer:debounce", debounce_bounce, LITEST_BUTTON, LITEST_TOUCHPAD, &buttons);
litest_add("pointer:debounce", debounce_bounce_check_immediate, LITEST_BUTTON, LITEST_TOUCHPAD);
litest_add_ranged("pointer:debounce", debounce_spurious, LITEST_BUTTON, LITEST_TOUCHPAD, &buttons);
litest_add("pointer:debounce", debounce_spurious_multibounce, LITEST_BUTTON, LITEST_TOUCHPAD);
litest_add("pointer:debounce_otherbutton", debounce_spurious_dont_enable_on_otherbutton, LITEST_BUTTON, LITEST_TOUCHPAD);
litest_add("pointer:debounce_otherbutton", debounce_spurious_cancel_debounce_otherbutton, LITEST_BUTTON, LITEST_TOUCHPAD);
litest_add("pointer:debounce_otherbutton", debounce_spurious_switch_to_otherbutton, LITEST_BUTTON, LITEST_TOUCHPAD);
litest_add_ranged("pointer:debounce", debounce_bounce, LITEST_BUTTON, LITEST_TOUCHPAD|LITEST_NO_DEBOUNCE, &buttons);
litest_add("pointer:debounce", debounce_bounce_check_immediate, LITEST_BUTTON, LITEST_TOUCHPAD|LITEST_NO_DEBOUNCE);
litest_add_ranged("pointer:debounce", debounce_spurious, LITEST_BUTTON, LITEST_TOUCHPAD|LITEST_NO_DEBOUNCE, &buttons);
litest_add("pointer:debounce", debounce_spurious_multibounce, LITEST_BUTTON, LITEST_TOUCHPAD|LITEST_NO_DEBOUNCE);
litest_add("pointer:debounce_otherbutton", debounce_spurious_dont_enable_on_otherbutton, LITEST_BUTTON, LITEST_TOUCHPAD|LITEST_NO_DEBOUNCE);
litest_add("pointer:debounce_otherbutton", debounce_spurious_cancel_debounce_otherbutton, LITEST_BUTTON, LITEST_TOUCHPAD|LITEST_NO_DEBOUNCE);
litest_add("pointer:debounce_otherbutton", debounce_spurious_switch_to_otherbutton, LITEST_BUTTON, LITEST_TOUCHPAD|LITEST_NO_DEBOUNCE);
}
......@@ -1591,6 +1591,117 @@ START_TEST(touchpad_3fg_tap_quickrelease)
}
END_TEST
START_TEST(touchpad_3fg_tap_pressure_btntool)
{
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
if (libevdev_get_abs_maximum(dev->evdev, ABS_MT_SLOT) >= 2)
return;
/* libinput doesn't export when it uses pressure detection, so we
* need to reconstruct this here. Specifically, semi-mt devices are
* non-mt in libinput, so if they have ABS_PRESSURE, they'll use it.
*/
if (!libevdev_has_event_code(dev->evdev, EV_ABS, ABS_MT_PRESSURE))
return;
litest_enable_tap(dev->libinput_device);
litest_enable_edge_scroll(dev);
litest_drain_events(li);
litest_touch_down(dev, 0, 50, 50);
litest_touch_down(dev, 1, 70, 50);
libinput_dispatch(li);
litest_touch_move_to(dev, 0, 50, 50, 50, 70, 10, 0);
litest_touch_move_to(dev, 1, 70, 50, 50, 70, 10, 0);
litest_drain_events(li);
/* drop below the pressure threshold in the same frame as starting a
* third touch, see
* E: 8713.954784 0001 014e 0001 # EV_KEY / BTN_TOOL_TRIPLETAP 1
* in https://bugs.freedesktop.org/attachment.cgi?id=137672
*/
litest_event(dev, EV_ABS, ABS_MT_PRESSURE, 3);
litest_event(dev, EV_ABS, ABS_PRESSURE, 3);
litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 0);
litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 1);
litest_event(dev, EV_SYN, SYN_REPORT, 0);
libinput_dispatch(li);
litest_push_event_frame(dev);
litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 1);
litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 0);
litest_pop_event_frame(dev);
litest_touch_up(dev, 0);
litest_touch_up(dev, 1);
libinput_dispatch(li);
litest_timeout_tap();
libinput_dispatch(li);
litest_assert_button_event(li,
BTN_MIDDLE,
LIBINPUT_BUTTON_STATE_PRESSED);
litest_assert_button_event(li,
BTN_MIDDLE,
LIBINPUT_BUTTON_STATE_RELEASED);
}
END_TEST
START_TEST(touchpad_3fg_tap_hover_btntool)
{
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
if (libevdev_get_abs_maximum(dev->evdev, ABS_MT_SLOT) >= 2)
return;
/* libinput doesn't export when it uses pressure detection, so we
* need to reconstruct this here. Specifically, semi-mt devices are
* non-mt in libinput, so if they have ABS_PRESSURE, they'll use it.
*/
if (libevdev_has_event_code(dev->evdev, EV_ABS, ABS_MT_PRESSURE))
return;
if (libevdev_has_property(dev->evdev, INPUT_PROP_SEMI_MT) &&
libevdev_has_event_code(dev->evdev, EV_ABS, ABS_PRESSURE))
return;
litest_enable_tap(dev->libinput_device);
litest_enable_edge_scroll(dev);
litest_drain_events(li);
litest_touch_down(dev, 0, 50, 50);
litest_touch_down(dev, 1, 70, 50);
libinput_dispatch(li);
litest_touch_move_to(dev, 0, 50, 50, 50, 70, 10, 0);
litest_touch_move_to(dev, 1, 70, 50, 50, 70, 10, 0);
litest_drain_events(li);
/* drop below the pressure threshold in the same frame as starting a
* third touch */
litest_event(dev, EV_KEY, BTN_TOUCH, 0);
litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 0);
litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 1);
litest_event(dev, EV_SYN, SYN_REPORT, 0);
libinput_dispatch(li);
litest_push_event_frame(dev);
litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 1);
litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 0);
litest_pop_event_frame(dev);
litest_assert_empty_queue(li);
litest_touch_up(dev, 0);
litest_touch_up(dev, 1);
}
END_TEST
START_TEST(touchpad_3fg_tap_btntool)
{
struct litest_device *dev = litest_current_device();
......@@ -3273,6 +3384,8 @@ litest_setup_tests_touchpad_tap(void)
litest_add_ranged("tap-3fg:3fg", touchpad_3fg_tap, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH, &tap_map_range);
litest_add("tap-3fg:3fg", touchpad_3fg_tap_tap_again, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
litest_add("tap-3fg:3fg", touchpad_3fg_tap_quickrelease, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
litest_add("tap-3fg:3fg", touchpad_3fg_tap_hover_btntool, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
litest_add("tap-3fg:3fg", touchpad_3fg_tap_pressure_btntool, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
litest_add_for_device("tap-3fg:3fg", touchpad_3fg_tap_btntool_pointerjump, LITEST_SYNAPTICS_TOPBUTTONPAD);
litest_add("tap-4fg:4fg", touchpad_4fg_tap, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH|LITEST_SEMI_MT);
litest_add("tap-4fg:4fg", touchpad_4fg_tap_quickrelease, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH|LITEST_SEMI_MT);
......
......@@ -953,7 +953,7 @@ START_TEST(touchpad_edge_scroll_into_area)
}
END_TEST
static int
static bool
touchpad_has_palm_detect_size(struct litest_device *dev)
{
double width, height;
......@@ -975,6 +975,20 @@ touchpad_has_palm_detect_size(struct litest_device *dev)
return rc == 0 && width >= 70;
}
static bool
touchpad_has_top_palm_detect_size(struct litest_device *dev)
{
double width, height;
int rc;
if (!touchpad_has_palm_detect_size(dev))
return false;
rc = libinput_device_get_size(dev->libinput_device, &width, &height);
return rc == 0 && height > 55;
}
START_TEST(touchpad_palm_detect_at_edge)
{
struct litest_device *dev = litest_current_device();
......@@ -1009,7 +1023,7 @@ START_TEST(touchpad_palm_detect_at_top)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
if (!touchpad_has_palm_detect_size(dev))
if (!touchpad_has_top_palm_detect_size(dev))
return;
litest_disable_tap(dev->libinput_device);
......@@ -1131,7 +1145,7 @@ START_TEST(touchpad_palm_detect_top_palm_stays_palm)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
if (!touchpad_has_palm_detect_size(dev))
if (!touchpad_has_top_palm_detect_size(dev))
return;
litest_disable_tap(dev->libinput_device);
......@@ -1178,7 +1192,7 @@ START_TEST(touchpad_palm_detect_top_palm_becomes_pointer)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
if (!touchpad_has_palm_detect_size(dev))
if (!touchpad_has_top_palm_detect_size(dev))
return;
litest_disable_tap(dev->libinput_device);
......@@ -1231,7 +1245,7 @@ START_TEST(touchpad_palm_detect_no_palm_moving_into_top)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
if (!touchpad_has_palm_detect_size(dev))
if (!touchpad_has_top_palm_detect_size(dev))
return;
litest_disable_tap(dev->libinput_device);
......@@ -1260,7 +1274,7 @@ START_TEST(touchpad_palm_detect_no_tap_top_edge)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
if (!touchpad_has_palm_detect_size(dev))
if (!touchpad_has_top_palm_detect_size(dev))
return;
litest_enable_tap(dev->libinput_device);
......@@ -4473,6 +4487,43 @@ START_TEST(touchpad_thumb_moving)
}
END_TEST
START_TEST(touchpad_thumb_moving_empty_slots)
{
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
litest_disable_tap(dev->libinput_device);
litest_enable_2fg_scroll(dev);
if (libevdev_get_num_slots(dev->evdev) < 3)
return;
litest_drain_events(li);
/* exceed the speed movement threshold in slot 0 */
litest_touch_down(dev, 0, 50, 20);
litest_touch_move_to(dev, 0, 50, 20, 70, 99, 15, 0);
litest_touch_up(dev, 0);
litest_drain_events(li);
/* scroll in slots 1 and 2 */
litest_touch_down(dev, 1, 50, 50);
litest_touch_down(dev, 2, 90, 50);
libinput_dispatch(li);
for (int i = 0, y = 50; i < 10; i++, y++) {
litest_touch_move_to(dev, 1, 50, y, 50, y + 1, 1, 0);
litest_touch_move_to(dev, 2, 50, y, 50, y + 1, 1, 0);
}
libinput_dispatch(li);
litest_touch_up(dev, 1);
litest_touch_up(dev, 2);
libinput_dispatch(li);
litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL, 2);
}
END_TEST
START_TEST(touchpad_thumb_clickfinger)
{
struct litest_device *dev = litest_current_device();
......@@ -4775,6 +4826,45 @@ START_TEST(touchpad_thumb_tap_hold_2ndfg_tap)
}
END_TEST
START_TEST(touchpad_thumb_move_and_tap)
{
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
struct axis_replacement axes[] = {
{ ABS_MT_PRESSURE, 75 },
{ -1, 0 }
};
if (!has_thumb_detect(dev))
return;
litest_enable_tap(dev->libinput_device);
litest_drain_events(li);
/* trigger thumb detection by pressure after a slight movement */
litest_touch_down(dev, 0, 50, 99);
litest_touch_move(dev, 0, 51, 99);
litest_touch_move_extended(dev, 0, 55, 99, axes);
libinput_dispatch(li);
litest_assert_empty_queue(li);
/* thumb is resting, check if tapping still works */
litest_touch_down(dev, 1, 50, 50);
litest_touch_up(dev, 1);
libinput_dispatch(li);
litest_timeout_tap();
litest_assert_button_event(li,
BTN_LEFT,
LIBINPUT_BUTTON_STATE_PRESSED);
litest_assert_button_event(li,
BTN_LEFT,
LIBINPUT_BUTTON_STATE_RELEASED);
litest_assert_empty_queue(li);
}
END_TEST
START_TEST(touchpad_tool_tripletap_touch_count)
{
struct litest_device *dev = litest_current_device();
......@@ -5423,6 +5513,111 @@ START_TEST(touchpad_pressure_tap_2fg_1fg_light)
}
END_TEST
START_TEST(touchpad_pressure_btntool)
{
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
struct axis_replacement axes[] = {
{ ABS_MT_PRESSURE, 5 },
{ ABS_PRESSURE, 5 },
{ -1, 0 }
};
/* we only have tripletap, can't test 4 slots because nothing will
* happen */
if (libevdev_get_num_slots(dev->evdev) != 2)
return;
if (!touchpad_has_pressure(dev))
return;
litest_enable_tap(dev->libinput_device);
litest_drain_events(li);
/* Two light touches down, doesn't count */
litest_touch_down_extended(dev, 0, 40, 50, axes);
litest_touch_down_extended(dev, 1, 45, 50, axes);
libinput_dispatch(li);
litest_assert_empty_queue(li);
/* Tripletap but since no finger is logically down, it doesn't count */
litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 0);
litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 1);
litest_event(dev, EV_SYN, SYN_REPORT, 0);
litest_assert_empty_queue(li);
/* back to two fingers */
litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 1);
litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 0);
litest_event(dev, EV_SYN, SYN_REPORT, 0);
libinput_dispatch(li);
/* make one finger real */
litest_touch_move_to(dev, 0, 40, 50, 41, 52, 10, 10);
litest_drain_events(li);
/* tripletap should now be 3 fingers tap */
litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 0);
litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 1);
litest_event(dev, EV_SYN, SYN_REPORT, 0);
libinput_dispatch(li);
litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 1);
litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 0);
litest_event(dev, EV_SYN, SYN_REPORT, 0);
libinput_dispatch(li);
litest_timeout_tap();
libinput_dispatch(li);
litest_assert_button_event(li,
BTN_MIDDLE,
LIBINPUT_BUTTON_STATE_PRESSED);
litest_assert_button_event(li,
BTN_MIDDLE,
LIBINPUT_BUTTON_STATE_RELEASED);
}
END_TEST
START_TEST(touchpad_pressure_semi_mt_2fg_goes_light)
{
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
struct axis_replacement axes[] = {
{ ABS_PRESSURE, 2 },
{ -1, 0 }
};
litest_enable_2fg_scroll(dev);
litest_drain_events(li);
litest_touch_down(dev, 0, 40, 50);
litest_touch_down(dev, 1, 60, 50);
litest_touch_move_two_touches(dev, 40, 50, 60, 50, 0, -20, 10, 0);
/* This should trigger a scroll end event */
litest_push_event_frame(dev);
litest_touch_move_extended(dev, 0, 40, 31, axes);
litest_touch_move_extended(dev, 1, 60, 31, axes);
litest_pop_event_frame(dev);
libinput_dispatch(li);
litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL, 0);
litest_push_event_frame(dev);
litest_touch_move_extended(dev, 0, 40, 35, axes);
litest_touch_move_extended(dev, 1, 60, 35, axes);
litest_pop_event_frame(dev);
litest_push_event_frame(dev);
litest_touch_move_extended(dev, 0, 40, 40, axes);
litest_touch_move_extended(dev, 1, 60, 40, axes);
litest_pop_event_frame(dev);
libinput_dispatch(li);
litest_assert_empty_queue(li);
}
END_TEST
static inline bool
touchpad_has_touch_size(struct litest_device *dev)
{
......@@ -5779,6 +5974,7 @@ litest_setup_tests_touchpad(void)
litest_add("touchpad:thumb", touchpad_thumb_begin_no_motion, LITEST_CLICKPAD, LITEST_ANY);
litest_add("touchpad:thumb", touchpad_thumb_update_no_motion, LITEST_CLICKPAD, LITEST_ANY);
litest_add("touchpad:thumb", touchpad_thumb_moving, LITEST_CLICKPAD, LITEST_ANY);
litest_add("touchpad:thumb", touchpad_thumb_moving_empty_slots, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
litest_add("touchpad:thumb", touchpad_thumb_clickfinger, LITEST_CLICKPAD, LITEST_ANY);
litest_add("touchpad:thumb", touchpad_thumb_btnarea, LITEST_CLICKPAD, LITEST_ANY);
litest_add("touchpad:thumb", touchpad_thumb_tap_begin, LITEST_CLICKPAD, LITEST_ANY);
......@@ -5786,6 +5982,7 @@ litest_setup_tests_touchpad(void)
litest_add("touchpad:thumb", touchpad_thumb_tap_hold, LITEST_CLICKPAD, LITEST_ANY);
litest_add("touchpad:thumb", touchpad_thumb_tap_hold_2ndfg, LITEST_CLICKPAD, LITEST_SINGLE_TOUCH);
litest_add("touchpad:thumb", touchpad_thumb_tap_hold_2ndfg_tap, LITEST_CLICKPAD, LITEST_SINGLE_TOUCH);
litest_add("touchpad:thumb", touchpad_thumb_move_and_tap, LITEST_CLICKPAD, LITEST_ANY);
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);
......@@ -5805,7 +6002,9 @@ litest_setup_tests_touchpad(void)
litest_add("touchpad:pressure", touchpad_pressure_2fg_st, LITEST_TOUCHPAD|LITEST_SINGLE_TOUCH, LITEST_ANY);
litest_add("touchpad:pressure", touchpad_pressure_tap, LITEST_TOUCHPAD, LITEST_ANY);
litest_add("touchpad:pressure", touchpad_pressure_tap_2fg, LITEST_TOUCHPAD, LITEST_ANY);
litest_add("touchpad:pressure", touchpad_pressure_tap_2fg_1fg_light, LITEST_TOUCHPAD, LITEST_ANY);
litest_add("touchpad:pressure", touchpad_pressure_tap_2fg_1fg_light, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
litest_add("touchpad:pressure", touchpad_pressure_btntool, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
litest_add("touchpad:pressure", touchpad_pressure_semi_mt_2fg_goes_light, LITEST_SEMI_MT, LITEST_ANY);
litest_add("touchpad:touch-size", touchpad_touch_size, LITEST_APPLE_CLICKPAD, LITEST_ANY);
litest_add("touchpad:touch-size", touchpad_touch_size_2fg, LITEST_APPLE_CLICKPAD, LITEST_ANY);
......
......@@ -379,6 +379,35 @@ START_TEST(trackpoint_palmdetect_require_min_events)
}
END_TEST
START_TEST(trackpoint_palmdetect_require_min_events_timeout)
{
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);
for (int i = 0; i < 10; i++) {
/* 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_timeout_trackpoint();
}
litest_delete_device(touchpad);
}
END_TEST
void
litest_setup_tests_trackpoint(void)
{
......@@ -393,4 +422,5 @@ litest_setup_tests_trackpoint(void)
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);
litest_add("trackpoint:palmdetect", trackpoint_palmdetect_require_min_events_timeout, LITEST_POINTINGSTICK, LITEST_ANY);
}
......@@ -394,6 +394,47 @@ START_TEST(udev_suspend_resume)
}
END_TEST
START_TEST(udev_resume_before_seat)
{
struct libinput *li;
struct udev *udev;
int rc;
udev = udev_new();
ck_assert(udev != NULL);
li = libinput_udev_create_context(&simple_interface, NULL, udev);
ck_assert(li != NULL);
rc = libinput_resume(li);
ck_assert_int_eq(rc, 0);
libinput_unref(li);
udev_unref(udev);
}
END_TEST
START_TEST(udev_suspend_resume_before_seat)
{
struct libinput *li;
struct udev *udev;
int rc;
udev = udev_new();
ck_assert(udev != NULL);
li = libinput_udev_create_context(&simple_interface, NULL, udev);
ck_assert(li != NULL);
libinput_suspend(li);
rc = libinput_resume(li);
ck_assert_int_eq(rc, 0);
libinput_unref(li);
udev_unref(udev);
}
END_TEST
START_TEST(udev_device_sysname)
{
struct libinput *li;
......@@ -619,6 +660,8 @@ litest_setup_tests_udev(void)
litest_add_for_device("udev:suspend", udev_double_suspend, LITEST_SYNAPTICS_CLICKPAD_X220);
litest_add_for_device("udev:suspend", udev_double_resume, LITEST_SYNAPTICS_CLICKPAD_X220);
litest_add_for_device("udev:suspend", udev_suspend_resume, LITEST_SYNAPTICS_CLICKPAD_X220);
litest_add_for_device("udev:suspend", udev_resume_before_seat, LITEST_SYNAPTICS_CLICKPAD_X220);
litest_add_for_device("udev:suspend", udev_suspend_resume_before_seat, LITEST_SYNAPTICS_CLICKPAD_X220);
litest_add_for_device("udev:device events", udev_device_sysname, LITEST_SYNAPTICS_CLICKPAD_X220);
litest_add_for_device("udev:seat", udev_seat_recycle, LITEST_SYNAPTICS_CLICKPAD_X220);
......
#!/bin/sh
#
# This does not honor $bindir properly, because we cannot get to it
# here. Does anyone build to something but prefix/bin?
#
bindir="${DESTDIR}/${MESON_INSTALL_PREFIX}/bin"
mkdir -p "$bindir"
bindir="${DESTDIR}${1}"
# Do not create bindir, because if it is not there now, we have a problem
cp "${MESON_SOURCE_ROOT}/tools/libinput-list-devices.compat" "${bindir}/libinput-list-devices"
cp "${MESON_SOURCE_ROOT}/tools/libinput-debug-events.compat" "${bindir}/libinput-debug-events"
......@@ -68,7 +68,7 @@ Enable or disable middle button emulation
.B \-\-enable\-dwt|\-\-disable\-dwt
Enable or disable disable-while-typing
.TP 8
.B \-\-set\-click\-method=[none|clickfinger|buttons]
.B \-\-set\-click\-method=[none|clickfinger|buttonareas]
Set the desired click method
.TP 8
.B \-\-set\-scroll\-method=[none|twofinger|edge|button]
......
......@@ -234,7 +234,7 @@ class Device(object):
ud = pyudev.Devices.from_device_file(context, self.path)
v = ud.get('LIBINPUT_ATTR_TOUCH_SIZE_RANGE')
if v:
self.up, self.down = colon_tuple(v)
self.down, self.up = colon_tuple(v)
v = ud.get('LIBINPUT_ATTR_PALM_SIZE_THRESHOLD')
if v:
......
......@@ -163,8 +163,8 @@ class Device(object):
prange = p.max - p.min
# libinput defaults
self.up = int(p.min + 0.12 * prange)
self.down = int(p.min + 0.10 * prange)
self.down = int(p.min + 0.12 * prange)
self.up = int(p.min + 0.10 * prange)
self.palm = 130 # the libinput default
self._init_thresholds_from_udev()
......@@ -189,7 +189,7 @@ class Device(object):
ud = pyudev.Devices.from_device_file(context, self.path)
v = ud.get('LIBINPUT_ATTR_PRESSURE_RANGE')
if v:
self.up, self.down = colon_tuple(v)