]> Pileus Git - ~andy/gtk/commitdiff
Broadway/Quartz/Win32: make event source prepare()/check() note paused status
authorOwen W. Taylor <otaylor@fishsoup.net>
Wed, 20 Feb 2013 17:27:07 +0000 (12:27 -0500)
committerOwen W. Taylor <otaylor@fishsoup.net>
Thu, 21 Feb 2013 14:59:58 +0000 (09:59 -0500)
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

gdk/broadway/gdkeventsource.c
gdk/quartz/gdkeventloop-quartz.c
gdk/win32/gdkevents-win32.c

index e9aa2c86b3bc2faac7211fa97f0c011d67739a68..a4399c431ef0c18184bf0a7bf9ed10d94d80aa82 100644 (file)
@@ -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;
index 479cd72a7eeeddd00580910854567a34c81e56a8..6691744f2c415754f1fe4e7e3c9733fc0bf297c1 100644 (file)
@@ -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 ();
 
index 962daf2d09e1fc7e4dfb3baa1c2aad10224efed0..7866f3177166fdf9e3412836fe7a97a6d66db310 100644 (file)
@@ -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 ();