@@ -16,7 +16,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
1616
1717 public signal void closed ();
1818
19- public Gala . WindowManager wm { get ; construct; }
19+ public Meta . Display display { get ; construct; }
2020 public Meta . WindowActor window_actor { get ; construct; }
2121
2222 private Clutter . Clone clone; // clone itself
@@ -52,12 +52,11 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
5252 || window_type == Meta . WindowType . MODAL_DIALOG ;
5353 }
5454
55- public PopupWindow (Gala . WindowManager wm , Meta .WindowActor window_actor ) {
56- Object (wm : wm , window_actor: window_actor);
55+ public PopupWindow (Meta . Display display , Meta .WindowActor window_actor ) {
56+ Object (display : display , window_actor: window_actor);
5757 }
5858
5959 construct {
60- unowned var display = wm. get_display ();
6160 var scale = display. get_monitor_scale (display. get_current_monitor ());
6261
6362 button_size = Gala . Utils . scale_to_int (36 , scale);
@@ -133,7 +132,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
133132 window. unmanaged. connect (on_close_click_clicked);
134133 window. notify[" appears-focused" ]. connect (update_window_focus);
135134
136- unowned var workspace_manager = wm . get_display () . get_workspace_manager ();
135+ unowned var workspace_manager = display . get_workspace_manager ();
137136 workspace_manager. active_workspace_changed. connect (update_window_focus);
138137 }
139138
@@ -143,15 +142,15 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
143142 opacity = 0 ;
144143
145144 save_easing_state ();
146- set_easing_duration (wm . enable_animations ? 200 : 0 );
145+ set_easing_duration (AnimationsSettings . get_animation_duration ( 200 ) );
147146 opacity = 255 ;
148147 restore_easing_state ();
149148 }
150149
151150 public override void hide () {
152151 opacity = 255 ;
153152
154- var duration = wm . enable_animations ? 200 : 0 ;
153+ var duration = AnimationsSettings . get_animation_duration ( 200 ) ;
155154 save_easing_state ();
156155 set_easing_duration (duration);
157156 opacity = 0 ;
@@ -173,7 +172,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
173172#else
174173 public override bool enter_event (Clutter . CrossingEvent event) {
175174#endif
176- var duration = wm . enable_animations ? 300 : 0 ;
175+ var duration = AnimationsSettings . get_animation_duration ( 300 ) ;
177176
178177 close_button. save_easing_state ();
179178 close_button. set_easing_duration (duration);
@@ -193,7 +192,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
193192#else
194193 public override bool leave_event (Clutter . CrossingEvent event) {
195194#endif
196- var duration = wm . enable_animations ? 300 : 0 ;
195+ var duration = AnimationsSettings . get_animation_duration ( 300 ) ;
197196
198197 close_button. save_easing_state ();
199198 close_button. set_easing_duration (duration);
@@ -215,15 +214,15 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
215214 }
216215
217216 private Clutter . Actor on_move_begin () {
218- wm . get_display () . set_cursor (Meta . Cursor . DND_IN_DRAG );
217+ display . set_cursor (Meta . Cursor . DND_IN_DRAG );
219218
220219 return this ;
221220 }
222221
223222 private void on_move_end () {
224223 reactive = true ;
225224 update_screen_position ();
226- wm . get_display () . set_cursor (Meta . Cursor . DEFAULT );
225+ display . set_cursor (Meta . Cursor . DEFAULT );
227226 }
228227
229228#if HAS_MUTTER45
@@ -245,7 +244,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
245244 grab = resize_button. get_stage (). grab (resize_button);
246245 resize_button. event. connect (on_resize_event);
247246
248- wm . get_display () . set_cursor (Meta . Cursor . SE_RESIZE );
247+ display . set_cursor (Meta . Cursor . SE_RESIZE );
249248
250249 return Clutter . EVENT_PROPAGATE ;
251250 }
@@ -306,7 +305,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
306305
307306 update_screen_position ();
308307
309- wm . get_display () . set_cursor (Meta . Cursor . DEFAULT );
308+ display . set_cursor (Meta . Cursor . DEFAULT );
310309 }
311310
312311 private void on_allocation_changed () {
@@ -315,7 +314,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
315314 }
316315
317316 private void on_close_click_clicked () {
318- var duration = wm . enable_animations ? FADE_OUT_TIMEOUT : 0 ;
317+ var duration = AnimationsSettings . get_animation_duration ( FADE_OUT_TIMEOUT ) ;
319318
320319 save_easing_state ();
321320 set_easing_duration (duration);
@@ -329,14 +328,14 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
329328 }
330329
331330 private void update_window_focus () {
332- unowned Meta . Window focus_window = wm . get_display () . get_focus_window ();
331+ unowned Meta . Window focus_window = display . get_focus_window ();
333332 if ((focus_window != null && ! get_window_is_normal (focus_window))
334333 || (previous_focus != null && ! get_window_is_normal (previous_focus))) {
335334 previous_focus = focus_window;
336335 return ;
337336 }
338337
339- unowned var workspace_manager = wm . get_display () . get_workspace_manager ();
338+ unowned var workspace_manager = display . get_workspace_manager ();
340339 unowned var active_workspace = workspace_manager. get_active_workspace ();
341340 unowned var window = window_actor. get_meta_window ();
342341
@@ -449,7 +448,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
449448 var screen_limit_start_y = SCREEN_MARGIN + monitor_y;
450449 var screen_limit_end_y = monitor_height + monitor_y - SCREEN_MARGIN - height;
451450
452- var duration = wm . enable_animations ? 300 : 0 ;
451+ var duration = AnimationsSettings . get_animation_duration ( 300 ) ;
453452
454453 save_easing_state ();
455454 set_easing_mode (Clutter . AnimationMode . EASE_OUT_BACK );
@@ -462,7 +461,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
462461 private bool place_window_off_screen () {
463462 off_screen = false ;
464463
465- var duration = wm . enable_animations ? 300 : 0 ;
464+ var duration = AnimationsSettings . get_animation_duration ( 300 ) ;
466465
467466 save_easing_state ();
468467 set_easing_mode (Clutter . AnimationMode . EASE_OUT_BACK );
@@ -520,7 +519,6 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
520519 }
521520
522521 private bool coord_is_in_other_monitor (float coord, Clutter . Orientation axis) {
523- var display = wm. get_display ();
524522 int n_monitors = display. get_n_monitors ();
525523
526524 if (n_monitors == 1 ) {
@@ -553,7 +551,6 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
553551#else
554552 private void get_current_monitor_rect (out Meta . Rectangle rect) {
555553#endif
556- var display = wm. get_display ();
557554 rect = display. get_monitor_geometry (display. get_current_monitor ());
558555 }
559556
0 commit comments