Timo Aaltonen pushed to branch debian-unstable at X Strike Force / lib / libinput
Commits:
-
560ba890
by Peter Hutterer at 2020-04-11T09:06:57+10:00
-
aec607ec
by Peter Hutterer at 2020-04-11T09:07:06+10:00
-
ce1c4c50
by Peter Hutterer at 2020-04-11T09:07:11+10:00
-
c2fa055f
by Peter Hutterer at 2020-04-11T09:07:42+10:00
-
7658efbd
by Peter Hutterer at 2020-04-11T09:13:14+10:00
-
5b500c0e
by Peter Hutterer at 2020-04-11T10:01:55+10:00
-
f34a4209
by Timo Aaltonen at 2020-04-14T17:52:38+03:00
-
037854e2
by Timo Aaltonen at 2020-04-14T17:55:56+03:00
12 changed files:
- debian/changelog
- doc/api/libinput.doxygen.in
- doc/user/touchpad-jumping-cursors.rst
- meson.build
- src/evdev-mt-touchpad.c
- src/evdev-mt-touchpad.h
- src/util-strings.h
- test/litest.c
- test/test-utils.c
- tools/libinput-record.c
- udev/80-libinput-device-groups.rules.in
- udev/90-libinput-fuzz-override.rules.in
Changes:
1 |
+libinput (1.15.5-1) unstable; urgency=medium
|
|
2 |
+ |
|
3 |
+ * New upstream release.
|
|
4 |
+ |
|
5 |
+ -- Timo Aaltonen <tjaalton@debian.org> Tue, 14 Apr 2020 17:54:11 +0300
|
|
6 |
+ |
|
1 | 7 |
libinput (1.15.4-1) unstable; urgency=medium
|
2 | 8 |
|
3 | 9 |
* New upstream release.
|
... | ... | @@ -10,7 +10,6 @@ MAX_INITIALIZER_LINES = 0 |
10 | 10 |
WARNINGS = YES
|
11 | 11 |
QUIET = YES
|
12 | 12 |
INPUT = "@builddir@"
|
13 |
-FILTER_PATTERNS = *.h *.dox
|
|
14 | 13 |
IMAGE_PATH = "@builddir@"
|
15 | 14 |
GENERATE_HTML = YES
|
16 | 15 |
HTML_OUTPUT = api
|
... | ... | @@ -14,10 +14,13 @@ position. |
14 | 14 |
When libinput detects a cursor jump it prints a bug warning to the log with
|
15 | 15 |
the text **"Touch jump detected and discarded."** and a link to this page.
|
16 | 16 |
|
17 |
-In most cases, this is a bug in the kernel driver and to libinput it appears
|
|
18 |
-that the touch point moves from its previous position. The pointer jump can
|
|
19 |
-usually be seen in the :ref:`libinput record <libinput-record>` output for the device:
|
|
17 |
+.. note:: This warning is ratelimited and will stop appearing after a few
|
|
18 |
+ times, even if the touchpad jumps continue.
|
|
20 | 19 |
|
20 |
+In most cases, this is a bug in the firmware (or kernel driver) and to
|
|
21 |
+libinput it appears that the touch point moves from its previous position.
|
|
22 |
+The pointer jump can usually be seen in the :ref:`libinput record
|
|
23 |
+<libinput-record>` output for the device:
|
|
21 | 24 |
|
22 | 25 |
::
|
23 | 26 |
|
... | ... | @@ -50,9 +53,14 @@ usually be seen in the :ref:`libinput record <libinput-record>` output for the d |
50 | 53 |
In this recording, the pointer jumps from its position 3752/2216 to
|
51 | 54 |
1640/4681 within a single frame. On this particular touchpad, this would
|
52 | 55 |
represent a physical move of almost 50mm. libinput detects some of these
|
53 |
-jumps and discards the movement but otherwise continues as usual. However,
|
|
54 |
-the bug should be fixed at the kernel level.
|
|
56 |
+jumps and discards the movement but otherwise continues as usual.
|
|
57 |
+If your only encounter with these jumps is the warning printed to the log,
|
|
58 |
+libinput functions as intended.
|
|
55 | 59 |
|
56 | 60 |
When you encounter the warning in the log, please generate a recording of
|
57 | 61 |
your touchpad with :ref:`libinput record <libinput-record>` and file a bug.
|
58 | 62 |
See :ref:`reporting_bugs` for more details.
|
63 |
+ |
|
64 |
+Note that it most cases, libinput cannot actually fix the issue. Filing a
|
|
65 |
+bug is useful to figure out if there are other factors at play or whether
|
|
66 |
+there are heuristics we can employ to reduce the impact.
|
1 | 1 |
project('libinput', 'c',
|
2 |
- version : '1.15.4',
|
|
2 |
+ version : '1.15.5',
|
|
3 | 3 |
license : 'MIT/Expat',
|
4 | 4 |
default_options : [ 'c_std=gnu99', 'warning_level=2' ],
|
5 | 5 |
meson_version : '>= 0.41.0')
|
... | ... | @@ -1718,10 +1718,11 @@ tp_process_state(struct tp_dispatch *tp, uint64_t time) |
1718 | 1718 |
|
1719 | 1719 |
if (tp_detect_jumps(tp, t, time)) {
|
1720 | 1720 |
if (!tp->semi_mt)
|
1721 |
- evdev_log_bug_kernel(tp->device,
|
|
1722 |
- "Touch jump detected and discarded.\n"
|
|
1723 |
- "See %stouchpad-jumping-cursors.html for details\n",
|
|
1724 |
- HTTP_DOC_LINK);
|
|
1721 |
+ evdev_log_bug_kernel_ratelimit(tp->device,
|
|
1722 |
+ &tp->jump.warning,
|
|
1723 |
+ "Touch jump detected and discarded.\n"
|
|
1724 |
+ "See %stouchpad-jumping-cursors.html for details\n",
|
|
1725 |
+ HTTP_DOC_LINK);
|
|
1725 | 1726 |
tp_motion_history_reset(t);
|
1726 | 1727 |
}
|
1727 | 1728 |
|
... | ... | @@ -3581,6 +3582,9 @@ tp_init(struct tp_dispatch *tp, |
3581 | 3582 |
if (!use_touch_size)
|
3582 | 3583 |
tp_init_pressure(tp, device);
|
3583 | 3584 |
|
3585 |
+ /* 5 warnings per 2 hours should be enough */
|
|
3586 |
+ ratelimit_init(&tp->jump.warning, s2us(2 * 60 * 60), 5);
|
|
3587 |
+ |
|
3584 | 3588 |
/* Set the dpi to that of the x axis, because that's what we normalize
|
3585 | 3589 |
to when needed*/
|
3586 | 3590 |
device->dpi = device->abs.absinfo_x->resolution * 25.4;
|
... | ... | @@ -279,6 +279,10 @@ struct tp_dispatch { |
279 | 279 |
*/
|
280 | 280 |
unsigned int fake_touches;
|
281 | 281 |
|
282 |
+ struct {
|
|
283 |
+ struct ratelimit warning;
|
|
284 |
+ } jump;
|
|
285 |
+ |
|
282 | 286 |
/* if pressure goes above high -> touch down,
|
283 | 287 |
if pressure then goes below low -> touch up */
|
284 | 288 |
struct {
|
... | ... | @@ -312,3 +312,29 @@ error: |
312 | 312 |
free(result);
|
313 | 313 |
return -1;
|
314 | 314 |
}
|
315 |
+ |
|
316 |
+/**
|
|
317 |
+ * Strip any of the characters in what from the beginning and end of the
|
|
318 |
+ * input string.
|
|
319 |
+ *
|
|
320 |
+ * @return a newly allocated string with none of "what" at the beginning or
|
|
321 |
+ * end of string
|
|
322 |
+ */
|
|
323 |
+static inline char *
|
|
324 |
+strstrip(const char *input, const char *what)
|
|
325 |
+{
|
|
326 |
+ char *str, *last;
|
|
327 |
+ |
|
328 |
+ str = safe_strdup(&input[strspn(input, what)]);
|
|
329 |
+ |
|
330 |
+ last = str;
|
|
331 |
+ |
|
332 |
+ for (char *c = str; *c != '\0'; c++) {
|
|
333 |
+ if (!strchr(what, *c))
|
|
334 |
+ last = c + 1;
|
|
335 |
+ }
|
|
336 |
+ |
|
337 |
+ *last = '\0';
|
|
338 |
+ |
|
339 |
+ return str;
|
|
340 |
+}
|
... | ... | @@ -725,7 +725,7 @@ litest_init_device_udev_rules(struct litest_test_device *dev, FILE *f) |
725 | 725 |
if (need_keyboard_builtin) {
|
726 | 726 |
fprintf(f, ""
|
727 | 727 |
"ATTRS{name}==\"litest %s*\","
|
728 |
- " IMPORT{builtin}+=\"keyboard\"\n",
|
|
728 |
+ " IMPORT{builtin}=\"keyboard\"\n",
|
|
729 | 729 |
dev->name);
|
730 | 730 |
}
|
731 | 731 |
|
... | ... | @@ -1033,6 +1033,44 @@ START_TEST(strjoin_test) |
1033 | 1033 |
}
|
1034 | 1034 |
END_TEST
|
1035 | 1035 |
|
1036 |
+START_TEST(strstrip_test)
|
|
1037 |
+{
|
|
1038 |
+ struct strstrip_test {
|
|
1039 |
+ const char *string;
|
|
1040 |
+ const char *expected;
|
|
1041 |
+ const char *what;
|
|
1042 |
+ } tests[] = {
|
|
1043 |
+ { "foo", "foo", "1234" },
|
|
1044 |
+ { "\"bar\"", "bar", "\"" },
|
|
1045 |
+ { "'bar'", "bar", "'" },
|
|
1046 |
+ { "\"bar\"", "\"bar\"", "'" },
|
|
1047 |
+ { "'bar'", "'bar'", "\"" },
|
|
1048 |
+ { "\"bar\"", "bar", "\"" },
|
|
1049 |
+ { "\"\"", "", "\"" },
|
|
1050 |
+ { "\"foo\"bar\"", "foo\"bar", "\"" },
|
|
1051 |
+ { "\"'foo\"bar\"", "foo\"bar", "\"'" },
|
|
1052 |
+ { "abcfooabcbarbca", "fooabcbar", "abc" },
|
|
1053 |
+ { "xxxxfoo", "foo", "x" },
|
|
1054 |
+ { "fooyyyy", "foo", "y" },
|
|
1055 |
+ { "xxxxfooyyyy", "foo", "xy" },
|
|
1056 |
+ { "x xfooy y", " xfooy ", "xy" },
|
|
1057 |
+ { " foo\n", "foo", " \n" },
|
|
1058 |
+ { "", "", "abc" },
|
|
1059 |
+ { "", "", "" },
|
|
1060 |
+ { NULL , NULL, NULL }
|
|
1061 |
+ };
|
|
1062 |
+ struct strstrip_test *t = tests;
|
|
1063 |
+ |
|
1064 |
+ while (t->string) {
|
|
1065 |
+ char *str;
|
|
1066 |
+ str = strstrip(t->string, t->what);
|
|
1067 |
+ ck_assert_str_eq(str, t->expected);
|
|
1068 |
+ free(str);
|
|
1069 |
+ t++;
|
|
1070 |
+ }
|
|
1071 |
+}
|
|
1072 |
+END_TEST
|
|
1073 |
+ |
|
1036 | 1074 |
START_TEST(list_test_insert)
|
1037 | 1075 |
{
|
1038 | 1076 |
struct list_test {
|
... | ... | @@ -1138,6 +1176,7 @@ litest_utils_suite(void) |
1138 | 1176 |
tcase_add_test(tc, strsplit_test);
|
1139 | 1177 |
tcase_add_test(tc, kvsplit_double_test);
|
1140 | 1178 |
tcase_add_test(tc, strjoin_test);
|
1179 |
+ tcase_add_test(tc, strstrip_test);
|
|
1141 | 1180 |
tcase_add_test(tc, time_conversion);
|
1142 | 1181 |
|
1143 | 1182 |
tcase_add_test(tc, list_test_insert);
|
... | ... | @@ -1447,9 +1447,9 @@ print_system_header(struct record_context *ctx) |
1447 | 1447 |
osrstr[strlen(osrstr) - 1] = '\0'; /* linebreak */
|
1448 | 1448 |
|
1449 | 1449 |
if (!distro && strneq(osrstr, "ID=", 3))
|
1450 |
- distro = safe_strdup(&osrstr[3]);
|
|
1450 |
+ distro = strstrip(&osrstr[3], "\"'");
|
|
1451 | 1451 |
else if (!version && strneq(osrstr, "VERSION_ID=", 11))
|
1452 |
- version = safe_strdup(&osrstr[11]);
|
|
1452 |
+ version = strstrip(&osrstr[11], "\"'");
|
|
1453 | 1453 |
|
1454 | 1454 |
if (distro && version) {
|
1455 | 1455 |
iprintf(ctx, "os: \"%s:%s\"\n", distro, version);
|
1 | 1 |
ACTION!="add|change", GOTO="libinput_device_group_end"
|
2 | 2 |
KERNEL!="event[0-9]*", GOTO="libinput_device_group_end"
|
3 | 3 |
|
4 |
-ATTRS{phys}=="?*", IMPORT{program}+="@UDEV_TEST_PATH@libinput-device-group %S%p"
|
|
4 |
+ATTRS{phys}=="?*", IMPORT{program}="@UDEV_TEST_PATH@libinput-device-group %S%p"
|
|
5 | 5 |
|
6 | 6 |
LABEL="libinput_device_group_end"
|
... | ... | @@ -15,12 +15,12 @@ KERNEL!="event*", GOTO="libinput_fuzz_override_end" |
15 | 15 |
# about that.
|
16 | 16 |
ATTRS{capabilities/abs}!="0", \
|
17 | 17 |
ENV{ID_INPUT_TOUCHPAD}=="1", \
|
18 |
- IMPORT{program}+="@UDEV_TEST_PATH@libinput-fuzz-extract %S%p", \
|
|
18 |
+ IMPORT{program}="@UDEV_TEST_PATH@libinput-fuzz-extract %S%p", \
|
|
19 | 19 |
RUN{program}+="@UDEV_TEST_PATH@libinput-fuzz-to-zero %S%p", \
|
20 | 20 |
GOTO="libinput_fuzz_override_end"
|
21 | 21 |
ATTRS{capabilities/abs}!="0", \
|
22 | 22 |
ENV{ID_INPUT_TOUCHSCREEN}=="1", \
|
23 |
- IMPORT{program}+="@UDEV_TEST_PATH@libinput-fuzz-extract %S%p", \
|
|
23 |
+ IMPORT{program}="@UDEV_TEST_PATH@libinput-fuzz-extract %S%p", \
|
|
24 | 24 |
RUN{program}+="@UDEV_TEST_PATH@libinput-fuzz-to-zero %S%p", \
|
25 | 25 |
GOTO="libinput_fuzz_override_end"
|
26 | 26 |
|