Check for pending events from the tail of the events queue

When checking for pending events we need to look from the tail of the
list backwards.
This commit is contained in:
Emmanuele Bassi 2007-08-21 15:48:37 +00:00
parent 1a2f0c95f5
commit 9d61c5c856

View File

@ -498,8 +498,8 @@ clutter_event_put (ClutterEvent *event)
{
ClutterMainContext *context = clutter_context_get_default ();
/* FIXME: check queue is valid */
g_return_if_fail (context != NULL);
g_return_if_fail (event != NULL);
g_return_if_fail (context->events_queue != NULL);
g_queue_push_head (context->events_queue, clutter_event_copy (event));
}
@ -528,14 +528,14 @@ clutter_events_pending (void)
return FALSE;
/* find the first non pending item */
item = context->events_queue->head;
item = context->events_queue->tail;
while (item)
{
ClutterEventPrivate *event = item->data;
if (!(event->flags & CLUTTER_EVENT_PENDING))
return TRUE;
item = item->next;
item = item->prev;
}
return FALSE;