After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 697285 - Inconsistent setting of the time member on the events
Inconsistent setting of the time member on the events
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: wayland
unspecified
Other Linux
: Normal normal
: ---
Assigned To: clutter-maint
clutter-maint
Depends on:
Blocks:
 
 
Reported: 2013-04-04 16:46 UTC by Rob Bradford
Modified: 2013-07-10 10:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wayland: Use a fake millisecond monotonic time source for event times (4.24 KB, patch)
2013-06-27 15:10 UTC, Rob Bradford
reviewed Details | Review
wayland: Use a fake millisecond monotonic time source for event times (4.10 KB, patch)
2013-06-27 15:29 UTC, Rob Bradford
committed Details | Review

Description Rob Bradford 2013-04-04 16:46:39 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.
Comment 1 Rob Bradford 2013-06-27 15:10:28 UTC
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.
Comment 2 Emmanuele Bassi (:ebassi) 2013-06-27 15:15:10 UTC
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.
Comment 3 Rob Bradford 2013-06-27 15:22:31 UTC
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.
Comment 4 Rob Bradford 2013-06-27 15:29:42 UTC
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.
Comment 5 Rob Bradford 2013-07-10 10:03:19 UTC
Attachment 247918 [details] pushed as 7df5988 - wayland: Use a fake millisecond monotonic time source for event times