clutter/evdev: Avoid losing key repeat timestamp resolution

Commit 9214d5029c changed the notify*
API to use microseconds and we already have a microsecond time source
here so we can use the timestamp directly without losing resolution at
this layer.

https://bugzilla.gnome.org/show_bug.cgi?id=774989
This commit is contained in:
Rui Matos 2016-11-24 18:17:22 +01:00
parent f8fd02d6ee
commit 2166a496fe

View File

@ -185,15 +185,13 @@ keyboard_repeat (gpointer data)
{ {
ClutterSeatEvdev *seat = data; ClutterSeatEvdev *seat = data;
GSource *source; GSource *source;
guint32 time_ms;
g_return_val_if_fail (seat->repeat_device != NULL, 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); source = g_main_context_find_source_by_id (NULL, seat->repeat_timer);
time_ms = g_source_get_time (source) / 1000;
clutter_seat_evdev_notify_key (seat, clutter_seat_evdev_notify_key (seat,
seat->repeat_device, seat->repeat_device,
ms2us (time_ms), g_source_get_time (source),
seat->repeat_key, seat->repeat_key,
AUTOREPEAT_VALUE, AUTOREPEAT_VALUE,
FALSE); FALSE);