Commit df3e19b4 authored by Owen W. Taylor's avatar Owen W. Taylor

Broadway/Quartz/Win32: make event source prepare()/check() note paused status

When events are paused, we should not return TRUE from prepare() or check().
GTK+ handles this for events that are already in the GTK+ queue, but
we also need suppress checks for events that are in the system queue - if we
return TRUE indicating that there are events in the system queue, then we'll
call dispatch(), and do nothing. The event source will spin, and will never
run the other phases of the paint clock.

(Broadway doesn't have a window system queue separate from the GDK event queue,
but we write the function the same way for consistency.)

https://bugzilla.gnome.org/show_bug.cgi?id=694274
parent 00a107cc
......@@ -61,6 +61,10 @@ gdk_event_source_prepare (GSource *source,
gdk_threads_enter ();
*timeout = -1;
if (display->event_pause_count > 0)
retval = FALSE;
else
retval = (_gdk_event_queue_find_first (display) != NULL);
gdk_threads_leave ();
......@@ -76,7 +80,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);
else
retval = FALSE;
......
......@@ -620,6 +620,9 @@ gdk_event_prepare (GSource *source,
*timeout = -1;
if (display->event_pause_count > 0)
retval = FALSE;
else
retval = (_gdk_event_queue_find_first (_gdk_display) != NULL ||
_gdk_quartz_event_loop_check_pending ());
......@@ -635,6 +638,9 @@ gdk_event_check (GSource *source)
gdk_threads_enter ();
if (display->event_pause_count > 0)
retval = FALSE;
else
retval = (_gdk_event_queue_find_first (_gdk_display) != NULL ||
_gdk_quartz_event_loop_check_pending ());
......
......@@ -3330,6 +3330,9 @@ gdk_event_prepare (GSource *source,
*timeout = -1;
if (display->event_pause_count > 0)
retval = FALSE;
else
retval = (_gdk_event_queue_find_first (_gdk_display) != NULL ||
(modal_win32_dialog == NULL &&
GetQueueStatus (QS_ALLINPUT) != 0));
......@@ -3346,16 +3349,14 @@ gdk_event_check (GSource *source)
gdk_threads_enter ();
if (event_poll_fd.revents & G_IO_IN)
{
if (display->event_pause_count > 0)
retval = FALSE;
else if (event_poll_fd.revents & G_IO_IN)
retval = (_gdk_event_queue_find_first (_gdk_display) != NULL ||
(modal_win32_dialog == NULL &&
GetQueueStatus (QS_ALLINPUT) != 0));
}
else
{
retval = FALSE;
}
gdk_threads_leave ();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment