mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 06:00:22 +00:00
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
This commit is contained in:
parent
00a107cc4c
commit
df3e19b449
@ -61,7 +61,11 @@ gdk_event_source_prepare (GSource *source,
|
||||
gdk_threads_enter ();
|
||||
|
||||
*timeout = -1;
|
||||
retval = (_gdk_event_queue_find_first (display) != NULL);
|
||||
|
||||
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,8 +620,11 @@ gdk_event_prepare (GSource *source,
|
||||
|
||||
*timeout = -1;
|
||||
|
||||
retval = (_gdk_event_queue_find_first (_gdk_display) != NULL ||
|
||||
_gdk_quartz_event_loop_check_pending ());
|
||||
if (display->event_pause_count > 0)
|
||||
retval = FALSE;
|
||||
else
|
||||
retval = (_gdk_event_queue_find_first (_gdk_display) != NULL ||
|
||||
_gdk_quartz_event_loop_check_pending ());
|
||||
|
||||
gdk_threads_leave ();
|
||||
|
||||
@ -635,8 +638,11 @@ gdk_event_check (GSource *source)
|
||||
|
||||
gdk_threads_enter ();
|
||||
|
||||
retval = (_gdk_event_queue_find_first (_gdk_display) != NULL ||
|
||||
_gdk_quartz_event_loop_check_pending ());
|
||||
if (display->event_pause_count > 0)
|
||||
retval = FALSE;
|
||||
else
|
||||
retval = (_gdk_event_queue_find_first (_gdk_display) != NULL ||
|
||||
_gdk_quartz_event_loop_check_pending ());
|
||||
|
||||
gdk_threads_leave ();
|
||||
|
||||
|
@ -3330,9 +3330,12 @@ gdk_event_prepare (GSource *source,
|
||||
|
||||
*timeout = -1;
|
||||
|
||||
retval = (_gdk_event_queue_find_first (_gdk_display) != NULL ||
|
||||
(modal_win32_dialog == NULL &&
|
||||
GetQueueStatus (QS_ALLINPUT) != 0));
|
||||
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));
|
||||
|
||||
gdk_threads_leave ();
|
||||
|
||||
@ -3346,16 +3349,14 @@ gdk_event_check (GSource *source)
|
||||
|
||||
gdk_threads_enter ();
|
||||
|
||||
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));
|
||||
}
|
||||
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;
|
||||
}
|
||||
retval = FALSE;
|
||||
|
||||
gdk_threads_leave ();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user