Re: Animation not working properly with the latest version



Ah, In the above, substitute "mapped" with "painted" - it's of course
OK to skip the animation when the actor isn't mapped but the animation
shouldn't be skipped when it hasn't been painted yet which is the case
now.

Jiri

On Sat, May 4, 2013 at 11:37 AM, Jiří Techet <techet gmail com> wrote:
Hi,

I'm a maintainer of libchamplain and tried to build it with the latest
clutter version from jhbuild but after building it, libchamplain
doesn't work properly - basically no animations work and the code
which should be executed in animation completion handlers isn't
executed. I have bisected this issue to the following clutter commit:

8f032d595263a2f4fdb057ae5d954ee8236e96cf
actor: Skip transitions on invisible actors

It seems that the animation is completely skipped now if the actor
isn't mapped - which means it is not possible just to create an actor,
add it to the stage and run the animation because at that point the
actor isn't mapped. Minimal example (by modifying clutter's test) is
below:

#include <stdlib.h>
#include <gmodule.h>
#include <clutter/clutter.h>

static ClutterActor *stage;

static gboolean
animate (ClutterActor *actor)
{
  clutter_actor_save_easing_state (actor);
  clutter_actor_set_easing_duration (actor, 2000);
  clutter_actor_set_rotation_angle (actor, CLUTTER_Z_AXIS, 360.0);
  clutter_actor_restore_easing_state (actor);

  return FALSE;
}

G_MODULE_EXPORT int
test_animation_main (int argc, char *argv[])
{
  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
    return 1;

  stage = clutter_stage_new ();
  clutter_actor_set_background_color (stage, clutter_color_get_static
(CLUTTER_COLOR_SKY_BLUE));
  g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);

  ClutterActor *actor = clutter_actor_new ();
  clutter_actor_set_background_color (actor, clutter_color_get_static
(CLUTTER_COLOR_ORANGE_LIGHT));
  clutter_actor_add_child (stage, actor);
  clutter_actor_set_size (actor, 100, 100);
  clutter_actor_set_pivot_point (actor, .5f, .5f);
  clutter_actor_set_translation (actor, -50, -50, 0);
  clutter_actor_set_position (actor,
                              clutter_actor_get_width (stage) / 2,
                              clutter_actor_get_height (stage) / 2);

  animate (actor);
//  g_timeout_add (350, animate, actor);

  clutter_actor_show (stage);

  clutter_main ();

  return EXIT_SUCCESS;
}

The above code won't trigger the animation. You can only get it
working if you comment-out the timeout function but I believe this is
not the intended behavior (if it is, it should only be done in 2.0
because this behavior is backward-incompatible and I bet it breaks a
lot of applications).

Jiri


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]