summaryrefslogtreecommitdiff
path: root/gdk/gdkinternals.h
diff options
context:
space:
mode:
authorOwen W. Taylor <otaylor@fishsoup.net>2013-11-11 18:04:34 -0500
committerMatthias Clasen <mclasen@redhat.com>2013-11-11 23:17:14 -0500
commitf50a3af1b7a24836c784797484cae14052cbfcdd (patch)
tree2bb0800523535b82ebc340506440a81c1d7c1465 /gdk/gdkinternals.h
parent0db8aeaad9f81d7d3b582cc9f0b096705bf0591a (diff)
downloadgtk+-f50a3af1b7a24836c784797484cae14052cbfcdd.tar.gz
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
Diffstat (limited to 'gdk/gdkinternals.h')
-rw-r--r--gdk/gdkinternals.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h
index b2456662ec..bebdec03b7 100644
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@ -156,7 +156,13 @@ typedef enum
* 1) touch events emulating pointer events
* 2) pointer events being emulated by a touch sequence.
*/
- GDK_EVENT_POINTER_EMULATED = 1 << 1
+ GDK_EVENT_POINTER_EMULATED = 1 << 1,
+
+ /* When we are ready to draw a frame, we pause event delivery,
+ * mark all events in the queue with this flag, and deliver
+ * only those events until we finish the frame.
+ */
+ GDK_EVENT_FLUSHED = 1 << 2
} GdkEventFlags;
struct _GdkEventPrivate
@@ -305,6 +311,7 @@ GList* _gdk_event_queue_insert_before(GdkDisplay *display,
GdkEvent *event);
void _gdk_event_queue_handle_motion_compression (GdkDisplay *display);
+void _gdk_event_queue_flush (GdkDisplay *display);
void _gdk_event_button_generate (GdkDisplay *display,
GdkEvent *event);