[Wayland-bugs] [Bug 90573] Handle timeouts before events after that timeout

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon May 25 18:43:43 PDT 2015


https://bugs.freedesktop.org/show_bug.cgi?id=90573

Peter Hutterer <peter.hutterer at who-t.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |peter.hutterer at who-t.net

--- Comment #1 from Peter Hutterer <peter.hutterer at who-t.net> ---
Dump of some notes:
the two functions that matter here are evdev_device_dispatch() and
libinput_timer_handler().

libinput_dispatch() would need to call into all sources with a get_timestamp(),
that can return the next time to process events from that source. Put that into
an ordered list, then start processing the sources according to that timestamp.

For timers we only have one event to process, but devices can have more than
one event waiting. So ideally pass the timestamp for the _next_ device in the
list into dispatch(). That way evdev_device_dispatch() can return the current
event timestamp whenever that exceeds the other device's timestamp value, and
be re-ordered into the list.

This does require us to store the event though, libevdev doesn't have a peek
event function, so we have to copy it into our struct, with the usual "valid"
marker flags.

Quick testing shows that this doesn't seem to really be an issue in real-world
usage though the tests hit this quite easily.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-bugs/attachments/20150526/c1ce2d19/attachment.html>


More information about the wayland-bugs mailing list