mirror of
https://gitlab.freedesktop.org/wayland/weston
synced 2024-10-15 09:28:34 +00:00
compositor: Use paced logger for unknown scroll source
Mimic the existing behaviour of logging 5 times, with no reset, but change it so it's per device instead of using a static variable. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
parent
a82cb25108
commit
805c7c4814
|
@ -248,7 +248,6 @@ static bool
|
||||||
handle_pointer_axis(struct libinput_device *libinput_device,
|
handle_pointer_axis(struct libinput_device *libinput_device,
|
||||||
struct libinput_event_pointer *pointer_event)
|
struct libinput_event_pointer *pointer_event)
|
||||||
{
|
{
|
||||||
static int warned;
|
|
||||||
struct evdev_device *device =
|
struct evdev_device *device =
|
||||||
libinput_device_get_user_data(libinput_device);
|
libinput_device_get_user_data(libinput_device);
|
||||||
double vert, horiz;
|
double vert, horiz;
|
||||||
|
@ -282,10 +281,8 @@ handle_pointer_axis(struct libinput_device *libinput_device,
|
||||||
wl_axis_source = WL_POINTER_AXIS_SOURCE_CONTINUOUS;
|
wl_axis_source = WL_POINTER_AXIS_SOURCE_CONTINUOUS;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (warned < 5) {
|
weston_log_paced(&device->unknown_scroll_pacer, 5, 0,
|
||||||
weston_log("Unknown scroll source %d.\n", source);
|
"Unknown scroll source %d.\n", source);
|
||||||
warned++;
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,7 @@ struct evdev_device {
|
||||||
char *output_name;
|
char *output_name;
|
||||||
int fd;
|
int fd;
|
||||||
bool override_wl_calibration;
|
bool override_wl_calibration;
|
||||||
|
struct weston_log_pacer unknown_scroll_pacer;
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue