Preserve ordering when placing synthetic events in the queue
authorEmmanuele Bassi <ebassi@openedhand.com>
Tue, 21 Aug 2007 15:48:13 +0000 (15:48 +0000)
committerEmmanuele Bassi <ebassi@openedhand.com>
Tue, 21 Aug 2007 15:48:13 +0000 (15:48 +0000)
commit277d86f654520ee42eeefa21de7a6647aa581235
tree1ce3e8c9d617f68f62a51180564bb199ed2434d6
parent910ca5340d33581cdbb7a820601d4ed6501547c4
Preserve ordering when placing synthetic events in the queue

When we are in the the event translation function sometimes we need to
synthesise events: the double and triple click events are synthetic events
placed on the queue after a sequence of events has been received, for
instance.

Until now, the events were placed on the queue after the translation from
the native events was successful. This led to a loss of ordering because
we put the synthesised event on the queue before the last event that
triggered it.

This patch puts the events on the queue before translating them, with a
"pending" flag set; if the translation sequence is completed then the flag
is removed - otherwise the event is removed from the queue altogether. The
queue manipulation functions have been modified to ignore the "pending"
flag when looking for events.

This patch also adds a private structure overlayed on the ClutterEvent
struct so that we can extend the events with private data without exposing
it in the public API.
clutter/clutter-event.c
clutter/clutter-private.h
clutter/eglx/clutter-event-egl.c
clutter/glx/clutter-event-glx.c
clutter/sdl/clutter-event-sdl.c