@@ -17,19 +17,25 @@ public class Gala.ActorTarget : Clutter.Actor, GestureTarget {
1717 }
1818 }
1919
20+ public bool animating { get { return ongoing_animations > 0 ; } }
21+
2022 private double [] current_progress;
23+ private double [] current_commit;
2124 private Gee . List<GestureTarget > targets;
2225
26+ private int ongoing_animations = 0 ;
27+
2328 construct {
2429 current_progress = new double [GestureAction . N_ACTIONS ];
30+ current_commit = new double [GestureAction . N_ACTIONS ];
2531 targets = new Gee .ArrayList<GestureTarget > ();
2632
2733 child_added. connect (on_child_added);
2834 }
2935
3036 private void sync_target (GestureTarget target ) {
3137 for (int action = 0 ; action < current_progress. length; action++ ) {
32- target. propagate (COMMIT , action, current_progress [action]);
38+ target. propagate (COMMIT , action, current_commit [action]);
3339 target. propagate (UPDATE , action, current_progress[action]);
3440 }
3541 }
@@ -51,16 +57,35 @@ public class Gala.ActorTarget : Clutter.Actor, GestureTarget {
5157 return current_progress[action];
5258 }
5359
60+ public double get_current_commit (GestureAction action ) {
61+ return current_commit[action];
62+ }
63+
5464 public virtual void start_progress (GestureAction action ) {}
5565 public virtual void update_progress (GestureAction action , double progress ) {}
5666 public virtual void commit_progress (GestureAction action , double to ) {}
5767 public virtual void end_progress (GestureAction action ) {}
5868
5969 public override void propagate (UpdateType update_type , GestureAction action , double progress ) {
60- current_progress[action] = progress;
70+ if (update_type == COMMIT ) {
71+ current_commit[action] = progress;
72+ } else {
73+ current_progress[action] = progress;
74+ }
75+
76+ foreach (var target in targets) {
77+ target. propagate (update_type, action, progress);
78+ }
79+
80+ for (var child = get_first_child (); child != null ; child = child. get_next_sibling ()) {
81+ if (child is ActorTarget ) {
82+ child. propagate (update_type, action, progress);
83+ }
84+ }
6185
6286 switch (update_type) {
6387 case START :
88+ ongoing_animations++ ;
6489 start_progress (action);
6590 break ;
6691 case UPDATE :
@@ -70,19 +95,10 @@ public class Gala.ActorTarget : Clutter.Actor, GestureTarget {
7095 commit_progress (action, progress);
7196 break ;
7297 case END :
98+ ongoing_animations-- ;
7399 end_progress (action);
74100 break ;
75101 }
76-
77- foreach (var target in targets) {
78- target. propagate (update_type, action, progress);
79- }
80-
81- for (var child = get_first_child (); child != null ; child = child. get_next_sibling ()) {
82- if (child is ActorTarget ) {
83- child. propagate (update_type, action, progress);
84- }
85- }
86102 }
87103
88104 private void on_child_added (Clutter .Actor child ) {
0 commit comments