GNOME Bugzilla – Bug 697285
Inconsistent setting of the time member on the events
Last modified: 2013-07-10 10:03:23 UTC
clutter-input-device-wayland.c 73: event->motion.time = _time; 103: event->button.time = /*_time*/ serial; 138: event->scroll.time = time; 340: event->crossing.time = 0; /* ?! */ 388: event->crossing.time = 0; /* ?! */ We need to save the serial on the events that get it for activating resize/move but also the time to allow us to do things like double click.
Created attachment 247917 [details] [review] wayland: Use a fake millisecond monotonic time source for event times The majority of Clutter input events require a time so that that the upper levels of abstraction can identify the ordering of events and also work out a click count. Although some Wayland events have microsecond timestamps not all those that Clutter expects do have. Therefore we would need to create some fake times for those events. Instead we always calculate our own times relative to the first event received.
Review of attachment 247917 [details] [review]: the win32 and egl framebuffer backends already use monotonic time for timestamps, so I guess we could consolidate a bunch of code. ::: clutter/wayland/clutter-input-device-wayland.c @@ +65,3 @@ +_clutter_wayland_get_time (void) +{ + static gint64 start_time = 0; do we need to have a start time at all? I'm genuinely asking because I don't see an actual need.
I think that's a good call - we're always going to be comparing two event times so it doesn't matter what the "zero" is.
Created attachment 247918 [details] [review] wayland: Use a fake millisecond monotonic time source for event times The majority of Clutter input events require a time so that that the upper levels of abstraction can identify the ordering of events and also work out a click count. Although some Wayland events have microsecond timestamps not all those that Clutter expects do have. Therefore we would need to create some fake times for those events. Instead we always calculate our own time using the monotonic time.
Attachment 247918 [details] pushed as 7df5988 - wayland: Use a fake millisecond monotonic time source for event times