From 9d61c5c8568b41f0a80ee4807afbbbfe0110458d Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 21 Aug 2007 15:48:37 +0000 Subject: [PATCH] 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. --- clutter/clutter-event.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/clutter/clutter-event.c b/clutter/clutter-event.c index c532351c9..83c6a9065 100644 --- a/clutter/clutter-event.c +++ b/clutter/clutter-event.c @@ -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;