diff options
author | Owen W. Taylor <otaylor@fishsoup.net> | 2012-09-26 10:28:06 -0400 |
---|---|---|
committer | Owen W. Taylor <otaylor@fishsoup.net> | 2013-02-14 17:19:49 -0500 |
commit | a69285da08a2a61d5fd817ee8ccb88a6b6deaef6 (patch) | |
tree | c4fdef3922ea6eca4d1e16ef320b3a6760cbe09b /gdk/gdkframeclock.h | |
parent | 05386b44e04bc23e6cd68b74dd9047b874a2020b (diff) | |
download | gtk+-a69285da08a2a61d5fd817ee8ccb88a6b6deaef6.tar.gz |
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
Diffstat (limited to 'gdk/gdkframeclock.h')
-rw-r--r-- | gdk/gdkframeclock.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gdk/gdkframeclock.h b/gdk/gdkframeclock.h index ae445737df..624f6fef4c 100644 --- a/gdk/gdkframeclock.h +++ b/gdk/gdkframeclock.h @@ -64,12 +64,14 @@ void gdk_frame_clock_target_set_clock (GdkFrameClockTarget *target, #define GDK_FRAME_CLOCK_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GDK_TYPE_FRAME_CLOCK, GdkFrameClockInterface)) typedef enum { - GDK_FRAME_CLOCK_PHASE_NONE = 0, - GDK_FRAME_CLOCK_PHASE_BEFORE_PAINT = 1 << 0, - GDK_FRAME_CLOCK_PHASE_UPDATE = 1 << 1, - GDK_FRAME_CLOCK_PHASE_LAYOUT = 1 << 2, - GDK_FRAME_CLOCK_PHASE_PAINT = 1 << 3, - GDK_FRAME_CLOCK_PHASE_AFTER_PAINT = 1 << 4 + GDK_FRAME_CLOCK_PHASE_NONE = 0, + GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS = 1 << 0, + GDK_FRAME_CLOCK_PHASE_BEFORE_PAINT = 1 << 1, + GDK_FRAME_CLOCK_PHASE_UPDATE = 1 << 2, + GDK_FRAME_CLOCK_PHASE_LAYOUT = 1 << 3, + GDK_FRAME_CLOCK_PHASE_PAINT = 1 << 4, + GDK_FRAME_CLOCK_PHASE_AFTER_PAINT = 1 << 5, + GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS = 1 << 6 } GdkFrameClockPhase; struct _GdkFrameClockInterface @@ -87,11 +89,13 @@ struct _GdkFrameClockInterface /* signals */ /* void (* frame_requested) (GdkFrameClock *clock); */ + /* void (* flush_events) (GdkFrameClock *clock); */ /* void (* before_paint) (GdkFrameClock *clock); */ /* void (* update) (GdkFrameClock *clock); */ /* void (* layout) (GdkFrameClock *clock); */ /* void (* paint) (GdkFrameClock *clock); */ /* void (* after_paint) (GdkFrameClock *clock); */ + /* void (* resume_events) (GdkFrameClock *clock); */ }; GType gdk_frame_clock_get_type (void) G_GNUC_CONST; |