Handle recursion from motion event handlers

If a motion event handler (or other handler running from the flush-events
phase of the frame clock) recursed the main loop then flushing wouldn't
complete until after the recursed main loop returned, and various aspects
of the state would get out of sync.

To fix this, change flushing of the event queue to simply mark events as
ready to flush, and let normal event delivery handle the rest.

https://bugzilla.gnome.org/show_bug.cgi?id=705176
This commit is contained in:
Owen W. Taylor
2013-11-11 18:04:34 -05:00
committed by Matthias Clasen
parent 0db8aeaad9
commit f50a3af1b7
10 changed files with 38 additions and 45 deletions

View File

@ -278,7 +278,7 @@ gdk_event_source_prepare (GSource *source,
*timeout = -1;
if (display->event_pause_count > 0)
retval = FALSE;
retval = _gdk_event_queue_find_first (display) != NULL;
else
retval = (_gdk_event_queue_find_first (display) != NULL ||
gdk_check_xpending (display));
@ -297,7 +297,7 @@ gdk_event_source_check (GSource *source)
gdk_threads_enter ();
if (event_source->display->event_pause_count > 0)
retval = FALSE;
retval = _gdk_event_queue_find_first (event_source->display) != NULL;
else if (event_source->event_poll_fd.revents & G_IO_IN)
retval = (_gdk_event_queue_find_first (event_source->display) != NULL ||
gdk_check_xpending (event_source->display));