mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-07 04:58:21 +02:00
plugin/wheel: ratelimit the 'missing hires' warning to once a day
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1260>
This commit is contained in:
parent
9b7f933797
commit
075a6dfaef
1 changed files with 5 additions and 1 deletions
|
|
@ -72,6 +72,8 @@ struct plugin_device {
|
||||||
struct libinput_plugin_timer *scroll_timer;
|
struct libinput_plugin_timer *scroll_timer;
|
||||||
enum wheel_direction dir;
|
enum wheel_direction dir;
|
||||||
bool ignore_small_hi_res_movements;
|
bool ignore_small_hi_res_movements;
|
||||||
|
|
||||||
|
struct ratelimit hires_warning_limit;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct plugin_data {
|
struct plugin_data {
|
||||||
|
|
@ -366,8 +368,9 @@ wheel_handle_state(struct plugin_device *pd, struct evdev_frame *frame, uint64_t
|
||||||
struct evdev_device *evdev = evdev_device(pd->device);
|
struct evdev_device *evdev = evdev_device(pd->device);
|
||||||
|
|
||||||
if (!pd->hi_res_event_received && (pd->lo_res.x != 0 || pd->lo_res.y != 0)) {
|
if (!pd->hi_res_event_received && (pd->lo_res.x != 0 || pd->lo_res.y != 0)) {
|
||||||
evdev_log_bug_kernel(
|
evdev_log_bug_kernel_ratelimit(
|
||||||
evdev,
|
evdev,
|
||||||
|
&pd->hires_warning_limit,
|
||||||
"device supports high-resolution scroll but only low-resolution events have been received.\n"
|
"device supports high-resolution scroll but only low-resolution events have been received.\n"
|
||||||
"See %s/incorrectly-enabled-hires.html for details\n",
|
"See %s/incorrectly-enabled-hires.html for details\n",
|
||||||
HTTP_DOC_LINK);
|
HTTP_DOC_LINK);
|
||||||
|
|
@ -409,6 +412,7 @@ wheel_plugin_device_create(struct libinput_plugin *libinput_plugin,
|
||||||
pd->state = WHEEL_STATE_NONE;
|
pd->state = WHEEL_STATE_NONE;
|
||||||
pd->dir = WHEEL_DIR_UNKNOW;
|
pd->dir = WHEEL_DIR_UNKNOW;
|
||||||
pd->ignore_small_hi_res_movements = !evdev_device_is_virtual(evdev);
|
pd->ignore_small_hi_res_movements = !evdev_device_is_virtual(evdev);
|
||||||
|
ratelimit_init(&pd->hires_warning_limit, s2us(24 * 60 * 60), 1);
|
||||||
|
|
||||||
if (pd->ignore_small_hi_res_movements) {
|
if (pd->ignore_small_hi_res_movements) {
|
||||||
pd->scroll_timer =
|
pd->scroll_timer =
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue