Avoid motion-compression in test-picking test
Using clutter_stage_get_actor_at_pos() rather than synthesizing events; the synthesized events were being compressed, so we were only tesitng one pick per frame. http://bugzilla.openedhand.com/show_bug.cgi?id=1637 Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
This commit is contained in:
parent
6e69692e22
commit
fc83e36477
@ -36,7 +36,6 @@ do_events (ClutterActor *stage)
|
|||||||
{
|
{
|
||||||
glong i;
|
glong i;
|
||||||
static gdouble angle = 0;
|
static gdouble angle = 0;
|
||||||
ClutterEvent event;
|
|
||||||
|
|
||||||
for (i = 0; i < n_events; i++)
|
for (i = 0; i < n_events; i++)
|
||||||
{
|
{
|
||||||
@ -44,18 +43,13 @@ do_events (ClutterActor *stage)
|
|||||||
while (angle > M_PI * 2.0)
|
while (angle > M_PI * 2.0)
|
||||||
angle -= M_PI * 2.0;
|
angle -= M_PI * 2.0;
|
||||||
|
|
||||||
event.type = CLUTTER_MOTION;
|
/* If we synthesized events, they would be motion compressed;
|
||||||
event.any.stage = CLUTTER_STAGE (stage);
|
* calling get_actor_at_position() doesn't have that problem
|
||||||
event.any.time = CLUTTER_CURRENT_TIME;
|
*/
|
||||||
event.motion.flags = 0;
|
clutter_stage_get_actor_at_pos (CLUTTER_STAGE (stage),
|
||||||
event.motion.source = NULL;
|
CLUTTER_PICK_REACTIVE,
|
||||||
event.motion.x = (gint)(256.0 + 206.0 * cos (angle));
|
256.0 + 206.0 * cos (angle),
|
||||||
event.motion.y = (gint)(256.0 + 206.0 * sin (angle));
|
256.0 + 206.0 * sin (angle));
|
||||||
event.motion.modifier_state = 0;
|
|
||||||
event.motion.axes = NULL;
|
|
||||||
event.motion.device = NULL;
|
|
||||||
|
|
||||||
clutter_event_put (&event);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user