@@ -128,30 +128,18 @@ public class Gala.WorkspaceClone : ActorTarget {
128128
129129 public WindowManager wm { get ; construct; }
130130 public Meta . Workspace workspace { get ; construct; }
131+ public float monitor_scale { get ; construct set ; }
132+
131133 public IconGroup icon_group { get ; private set ; }
132134 public WindowCloneContainer window_container { get ; private set ; }
133135
134- private float _scale_factor = 1.0f ;
135- public float scale_factor {
136- get {
137- return _scale_factor;
138- }
139- set {
140- if (value != _scale_factor) {
141- _scale_factor = value ;
142- reallocate ();
143- update_targets ();
144- }
145- }
146- }
147-
148136 private BackgroundManager background;
149137 private bool opened;
150138
151139 private uint hover_activate_timeout = 0 ;
152140
153- public WorkspaceClone (WindowManager wm , Meta .Workspace workspace , float scale ) {
154- Object (wm: wm, workspace: workspace, scale_factor : scale );
141+ public WorkspaceClone (WindowManager wm, Meta . Workspace workspace, float monitor_scale ) {
142+ Object (wm: wm, workspace: workspace, monitor_scale : monitor_scale );
155143 }
156144
157145 construct {
@@ -166,15 +154,17 @@ public class Gala.WorkspaceClone : ActorTarget {
166154 background = new FramedBackground (display);
167155 background. add_action (background_click_action);
168156
169- window_container = new WindowCloneContainer (wm, scale_factor ) {
157+ window_container = new WindowCloneContainer (wm, monitor_scale ) {
170158 width = monitor_geometry. width,
171159 height = monitor_geometry. height,
172160 };
173161 window_container. window_selected. connect ((w) = > { window_selected (w); });
174162 window_container. requested_close. connect (() = > activate (true ));
163+ bind_property (" monitor-scale" , window_container, " monitor-scale" );
175164
176- icon_group = new IconGroup (display, workspace, scale_factor );
165+ icon_group = new IconGroup (display, workspace, monitor_scale );
177166 icon_group. selected. connect (() = > activate (true ));
167+ bind_property (" monitor-scale" , icon_group, " scale-factor" );
178168
179169 var icons_drop_action = new DragDropAction (DragDropActionType . DESTINATION , " multitaskingview-window" );
180170 icon_group. add_action (icons_drop_action);
@@ -221,7 +211,7 @@ public class Gala.WorkspaceClone : ActorTarget {
221211
222212 unowned var monitor_manager = display. get_context (). get_backend (). get_monitor_manager ();
223213 monitor_manager. monitors_changed. connect (update_targets);
224-
214+ notify[ " monitor-scale " ] . connect (update_targets);
225215 update_targets ();
226216 }
227217
@@ -238,11 +228,6 @@ public class Gala.WorkspaceClone : ActorTarget {
238228 icon_group. destroy ();
239229 }
240230
241- private void reallocate () {
242- icon_group. scale_factor = scale_factor;
243- window_container. monitor_scale = scale_factor;
244- }
245-
246231 /**
247232 * Add a window to the WindowCloneContainer and the IconGroup if it really
248233 * belongs to this workspace and this monitor.
@@ -301,8 +286,8 @@ public class Gala.WorkspaceClone : ActorTarget {
301286
302287 var monitor = display. get_monitor_geometry (display. get_primary_monitor ());
303288
304- var scale = (float )(monitor. height - InternalUtils . scale_to_int (TOP_OFFSET + BOTTOM_OFFSET , scale_factor )) / monitor. height;
305- var pivot_y = InternalUtils . scale_to_int (TOP_OFFSET , scale_factor ) / (monitor. height - monitor. height * scale);
289+ var scale = (float )(monitor. height - InternalUtils . scale_to_int (TOP_OFFSET + BOTTOM_OFFSET , monitor_scale )) / monitor. height;
290+ var pivot_y = InternalUtils . scale_to_int (TOP_OFFSET , monitor_scale ) / (monitor. height - monitor. height * scale);
306291 background. set_pivot_point (0.5f , pivot_y);
307292
308293 var initial_width = monitor. width;
@@ -312,10 +297,10 @@ public class Gala.WorkspaceClone : ActorTarget {
312297 add_target (new PropertyTarget (MULTITASKING_VIEW , background, " scale-x" , typeof (double ), 1d , (double ) scale));
313298 add_target (new PropertyTarget (MULTITASKING_VIEW , background, " scale-y" , typeof (double ), 1d , (double ) scale));
314299
315- window_container. padding_top = InternalUtils . scale_to_int (TOP_OFFSET , scale_factor );
300+ window_container. padding_top = InternalUtils . scale_to_int (TOP_OFFSET , monitor_scale );
316301 window_container. padding_left =
317302 window_container. padding_right = (int )(monitor. width - monitor. width * scale) / 2 ;
318- window_container. padding_bottom = InternalUtils . scale_to_int (BOTTOM_OFFSET , scale_factor );
303+ window_container. padding_bottom = InternalUtils . scale_to_int (BOTTOM_OFFSET , monitor_scale );
319304 }
320305
321306 public override void update_progress (GestureAction action, double progress) {
0 commit comments