gdk_display_get_event: don't unqueue events from the windowing system when paused

Unqueuing events from the windowing system when paused could result
in weird reordering if event filters resulted in application-visible
behavior. Since we now resume events when the frame clock is frozen,
we now no longer count on low-level event handling running while
event handling is paused.

https://bugzilla.gnome.org/show_bug.cgi?id=685460
This commit is contained in:
Owen W. Taylor 2012-10-07 11:47:49 -04:00
parent 3cef97f10d
commit d446dda920
2 changed files with 13 additions and 7 deletions

View File

@ -307,12 +307,12 @@ gdk_display_get_event (GdkDisplay *display)
{
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
GDK_DISPLAY_GET_CLASS (display)->queue_events (display);
if (display->events_paused)
return NULL;
else
return _gdk_event_unqueue (display);
GDK_DISPLAY_GET_CLASS (display)->queue_events (display);
return _gdk_event_unqueue (display);
}
/**

View File

@ -276,8 +276,12 @@ gdk_event_source_prepare (GSource *source,
gdk_threads_enter ();
*timeout = -1;
retval = (_gdk_event_queue_find_first (display) != NULL ||
gdk_check_xpending (display));
if (display->event_pause_count > 0)
retval = FALSE;
else
retval = (_gdk_event_queue_find_first (display) != NULL ||
gdk_check_xpending (display));
gdk_threads_leave ();
@ -292,7 +296,9 @@ gdk_event_source_check (GSource *source)
gdk_threads_enter ();
if (event_source->event_poll_fd.revents & G_IO_IN)
if (event_source->display->event_pause_count > 0)
retval = FALSE;
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));
else