mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-06 17:18:09 +02:00
touchpad: reduce the jumping cursor warnings to 5 per day
It's been a while since we really could do something about those jumps, so let's assume most of these are informative and not a bug in libinput. For that let's not spam the user's journal and ratelimit it to a handful a day. Per day because that increases the chance of an error being present in the recent logs if the user does search for it. Related #663 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
6c869071fb
commit
77b36de85d
3 changed files with 9 additions and 2 deletions
|
|
@ -3667,8 +3667,8 @@ tp_init(struct tp_dispatch *tp,
|
||||||
if (!use_touch_size)
|
if (!use_touch_size)
|
||||||
tp_init_pressure(tp, device);
|
tp_init_pressure(tp, device);
|
||||||
|
|
||||||
/* 5 warnings per 2 hours should be enough */
|
/* 5 warnings per 24 hours should be enough */
|
||||||
ratelimit_init(&tp->jump.warning, s2us(2 * 60 * 60), 5);
|
ratelimit_init(&tp->jump.warning, h2us(24), 5);
|
||||||
|
|
||||||
/* Set the dpi to that of the x axis, because that's what we normalize
|
/* Set the dpi to that of the x axis, because that's what we normalize
|
||||||
to when needed*/
|
to when needed*/
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,12 @@ s2us(uint64_t s)
|
||||||
return ms2us(s * 1000);
|
return ms2us(s * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline uint64_t
|
||||||
|
h2us(uint64_t h)
|
||||||
|
{
|
||||||
|
return s2us(h * 3600);
|
||||||
|
}
|
||||||
|
|
||||||
static inline uint32_t
|
static inline uint32_t
|
||||||
us2ms(uint64_t us)
|
us2ms(uint64_t us)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -707,6 +707,7 @@ START_TEST(time_conversion)
|
||||||
ck_assert_int_eq(ns2us(10000), 10);
|
ck_assert_int_eq(ns2us(10000), 10);
|
||||||
ck_assert_int_eq(ms2us(10), 10000);
|
ck_assert_int_eq(ms2us(10), 10000);
|
||||||
ck_assert_int_eq(s2us(1), 1000000);
|
ck_assert_int_eq(s2us(1), 1000000);
|
||||||
|
ck_assert_int_eq(h2us(2), s2us(2 * 60 * 60));
|
||||||
ck_assert_int_eq(us2ms(10000), 10);
|
ck_assert_int_eq(us2ms(10000), 10);
|
||||||
}
|
}
|
||||||
END_TEST
|
END_TEST
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue