[gtk/flush-events: 2/2] gdk: Deliver queued events on flush
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/flush-events: 2/2] gdk: Deliver queued events on flush
- Date: Fri, 23 Oct 2020 21:05:16 +0000 (UTC)
commit c5ed5c5ff995f504de964fa1bc8472a4f670757f
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Oct 23 17:03:00 2020 -0400
gdk: Deliver queued events on flush
The current code was marking queued events as flushed,
but left them in the queue. That doesn't make sense to
me - we should deliver all events we have before we
reach the paint phase of the frame cycle.
gdk/gdkevents.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index c768d22f23..9cfefd0d39 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -814,12 +814,17 @@ _gdk_event_queue_handle_motion_compression (GdkDisplay *display)
void
_gdk_event_queue_flush (GdkDisplay *display)
{
- GList *tmp_list;
-
- for (tmp_list = display->queued_events.head; tmp_list; tmp_list = tmp_list->next)
+ while (TRUE)
{
- GdkEvent *event = tmp_list->data;
+ GdkEvent *event;
+
+ event = (GdkEvent *)g_queue_pop_head (&display->queued_events);
+ if (!event)
+ return;
+
event->flags |= GDK_EVENT_FLUSHED;
+ _gdk_event_emit (event);
+ gdk_event_unref (event);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]