diff --git a/clutter/clutter/evdev/clutter-device-manager-evdev.c b/clutter/clutter/evdev/clutter-device-manager-evdev.c index c03c68cec..04dcb2eb7 100644 --- a/clutter/clutter/evdev/clutter-device-manager-evdev.c +++ b/clutter/clutter/evdev/clutter-device-manager-evdev.c @@ -2261,6 +2261,12 @@ _clutter_device_manager_evdev_acquire_device_id (ClutterDeviceManagerEvdev *mana return next_id; } +void +_clutter_device_manager_evdev_dispatch (ClutterDeviceManagerEvdev *manager_evdev) +{ + dispatch_libinput (manager_evdev); +} + static int compare_ids (gconstpointer a, gconstpointer b) diff --git a/clutter/clutter/evdev/clutter-device-manager-evdev.h b/clutter/clutter/evdev/clutter-device-manager-evdev.h index 1b01b8d06..c2dbe3198 100644 --- a/clutter/clutter/evdev/clutter-device-manager-evdev.h +++ b/clutter/clutter/evdev/clutter-device-manager-evdev.h @@ -76,6 +76,8 @@ void _clutter_device_manager_evdev_constrain_pointer (ClutterDeviceManagerEvdev float *new_x, float *new_y); +void _clutter_device_manager_evdev_dispatch (ClutterDeviceManagerEvdev *manager_evdev); + static inline guint64 us (guint64 us) { diff --git a/clutter/clutter/evdev/clutter-seat-evdev.c b/clutter/clutter/evdev/clutter-seat-evdev.c index 2fc040bb6..17464cf75 100644 --- a/clutter/clutter/evdev/clutter-seat-evdev.c +++ b/clutter/clutter/evdev/clutter-seat-evdev.c @@ -186,6 +186,12 @@ keyboard_repeat (gpointer data) ClutterSeatEvdev *seat = data; GSource *source; + /* There might be events queued in libinput that could cancel the + repeat timer. */ + _clutter_device_manager_evdev_dispatch (seat->manager_evdev); + if (!seat->repeat_timer) + return G_SOURCE_REMOVE; + g_return_val_if_fail (seat->repeat_device != NULL, G_SOURCE_REMOVE); source = g_main_context_find_source_by_id (NULL, seat->repeat_timer);