group: make it comparable to ClutterBox
authorRobert Bragg <robert@linux.intel.com>
Tue, 9 Feb 2010 18:54:28 +0000 (18:54 +0000)
committerRobert Bragg <robert@linux.intel.com>
Fri, 12 Feb 2010 12:31:24 +0000 (12:31 +0000)
commit4355621aebb075bc34b50a89f8ba99e8b8e12ff7
tree1d93f2e96f880d45c478143bcbcfc9ae96c6d84d
parent34c7611407154fcbb61c82c959c2a38972c2534f
group: make it comparable to ClutterBox

There is a lot of duplication between ClutterGroup and ClutterBox so
this makes the two files diff-able so that new fixes can easily be
ported to both and bug fixes missing in one or the other can be spotted
more easily. This doesn't change the behaviour of either actor; it's
really just a shuffle around of code and normalizes the coding style to
make the files comparable.

This has already uncovered one bug in ClutterBox, and also highlights
a bug in ClutterGroup + many other actors:

1) ClutterGroup::real_foreach was recently changed to use
   g_list_foreach instead of manually iterating the child list so it can
   safely handle calls like:
     clutter_container_foreach (container, clutter_actor_destroy);
   ClutterBox is still manually iterating the list.

2) In ClutterGroup we guard _queue_redraw() calls like this:
    if (CLUTTER_ACTOR_IS_VISIBLE (container))
clutter_actor_queue_redraw (CLUTTER_ACTOR (container));
   In ClutterBox we don't:
     I think ClutterBox is correct here because
     clutter_actor_queue_redraw already optimizes the case where the
     actor's not visible, but it also considers that the actor may be
     cloned and so the guard in ClutterGroup could break clones. This
     actually highlights a wider clutter bug since the same kinds of
     guards can be found in all other clutter actors.
clutter/clutter-box.c
clutter/clutter-group.c