From a69285da08a2a61d5fd817ee8ccb88a6b6deaef6 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Wed, 26 Sep 2012 10:28:06 -0400 Subject: Compress motion synchronized with the paint cycle When we have pending motion events, instead of delivering them directly, request the new FLUSH_EVENTS phase of the frame clock. This allows us to compress repeated motion events sent to the same window. In the FLUSH_EVENTS phase, which occur at priority GDK_PRIORITY_EVENTS + 1, we deliver any pending motion events then turn off event delivery until the end of the next frame. Turning off event delivery means that we'll reliably paint the compressed motion events even if more have arrived. Add a motion-compression test case which demonstrates behavior when an application takes too long handle motion events. It is unusable without this patch but behaves fine with the patch. https://bugzilla.gnome.org/show_bug.cgi?id=685460 --- gdk/gdkinternals.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gdk/gdkinternals.h') diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h index fb561e6f74..babef6e7f6 100644 --- a/gdk/gdkinternals.h +++ b/gdk/gdkinternals.h @@ -300,6 +300,9 @@ GList* _gdk_event_queue_insert_after (GdkDisplay *display, GList* _gdk_event_queue_insert_before(GdkDisplay *display, GdkEvent *after_event, GdkEvent *event); + +void _gdk_event_queue_handle_motion_compression (GdkDisplay *display); + void _gdk_event_button_generate (GdkDisplay *display, GdkEvent *event); -- cgit v1.2.1