summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Landwerlin <llandwerlin@gmail.com>2013-10-09 18:35:59 +0100
committerLionel Landwerlin <llandwerlin@gmail.com>2013-10-09 21:56:50 +0100
commitc87b794739d93df6547cf40aba93b2efbf70c22f (patch)
tree397ae0ba078f3d353e3756039cbb7490938d17aa
parent1546e48e04002560ede5589578891d6b287a9c35 (diff)
downloadclutter-c87b794739d93df6547cf40aba93b2efbf70c22f.tar.gz
stage: implement touch event throttling
https://bugzilla.gnome.org/show_bug.cgi?id=709761
-rw-r--r--clutter/clutter-stage.c38
1 files changed, 25 insertions, 13 deletions
diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c
index a7eba200e..0fcdd2423 100644
--- a/clutter/clutter-stage.c
+++ b/clutter/clutter-stage.c
@@ -1041,19 +1041,31 @@ _clutter_stage_process_queued_events (ClutterStage *stage)
check_device = TRUE;
/* Skip consecutive motion events coming from the same device */
- if (priv->throttle_motion_events &&
- next_event != NULL &&
- event->type == CLUTTER_MOTION &&
- (next_event->type == CLUTTER_MOTION ||
- next_event->type == CLUTTER_LEAVE) &&
- (!check_device || (device == next_device)))
- {
- CLUTTER_NOTE (EVENT,
- "Omitting motion event at %d, %d",
- (int) event->motion.x,
- (int) event->motion.y);
- goto next_event;
- }
+ if (priv->throttle_motion_events && next_event != NULL)
+ {
+ if (event->type == CLUTTER_MOTION &&
+ (next_event->type == CLUTTER_MOTION ||
+ next_event->type == CLUTTER_LEAVE) &&
+ (!check_device || (device == next_device)))
+ {
+ CLUTTER_NOTE (EVENT,
+ "Omitting motion event at %d, %d",
+ (int) event->motion.x,
+ (int) event->motion.y);
+ goto next_event;
+ }
+ else if (event->type == CLUTTER_TOUCH_UPDATE &&
+ (next_event->type == CLUTTER_TOUCH_UPDATE ||
+ next_event->type == CLUTTER_LEAVE) &&
+ (!check_device || (device == next_device)))
+ {
+ CLUTTER_NOTE (EVENT,
+ "Omitting touch update event at %d, %d",
+ (int) event->touch.x,
+ (int) event->touch.y);
+ goto next_event;
+ }
+ }
_clutter_process_event (event);