@@ -42,8 +42,6 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
4242 */
4343 public bool active {
4444 set {
45- active_shape. update_color ();
46-
4745 active_shape. save_easing_state ();
4846 active_shape. set_easing_duration (Utils . get_animation_duration (FADE_ANIMATION_DURATION ));
4947 active_shape. opacity = value ? 255 : 0 ;
@@ -127,8 +125,9 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
127125 add_action (drag_action);
128126 }
129127
130- active_shape = new ActiveShape (monitor_scale);
131- active_shape. opacity = 0 ;
128+ active_shape = new ActiveShape (monitor_scale) {
129+ opacity = 0
130+ };
132131 bind_property (" monitor-scale" , active_shape, " monitor-scale" );
133132
134133 clone_container = new Clutter .Actor () {
@@ -675,7 +674,7 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
675674 */
676675 private class ActiveShape : Clutter .Actor {
677676 private const int BORDER_RADIUS = 16 ;
678- private const double COLOR_OPACITY = 0.8 ;
677+ private const uint8 COLOR_OPACITY = 204 ;
679678
680679 public float monitor_scale { get ; construct set ; }
681680
@@ -687,10 +686,19 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
687686 var rounded_corners_effect = new RoundedCornersEffect (BORDER_RADIUS , monitor_scale);
688687 bind_property (" monitor-scale" , rounded_corners_effect, " monitor-scale" );
689688 add_effect (rounded_corners_effect);
690- }
691689
692- public void update_color () {
693- background_color = Drawing . StyleManager . get_instance (). theme_accent_color;
690+ unowned var style_manager = Drawing . StyleManager . get_instance ();
691+ style_manager. bind_property (" theme-accent-color" , this , " background-color" , SYNC_CREATE , (binding, from_value, ref to_value) = > {
692+ #if ! HAS_MUTTER47
693+ var new_color = (Clutter . Color ) from_value;
694+ #else
695+ var new_color = (Cogl . Color ) from_value;
696+ #endif
697+ new_color. alpha = COLOR_OPACITY ;
698+
699+ to_value. set_boxed (&new_color);
700+ return true ;
701+ });
694702 }
695703 }
696704}
0 commit comments