Merge lp:~tintou/gala/deprecation-removal into lp:gala

Proposed by Corentin Noël
Status: Rejected
Rejected by: Danielle Foré
Proposed branch: lp:~tintou/gala/deprecation-removal
Merge into: lp:gala
Diff against target: 513 lines (+178/-98)
5 files modified
src/DBus.vala (+1/-1)
src/Widgets/WindowClone.vala (+3/-0)
src/Widgets/WindowSwitcher.vala (+9/-4)
src/Widgets/WorkspaceInsertThumb.vala (+1/-2)
src/WindowManager.vala (+164/-91)
To merge this branch: bzr merge lp:~tintou/gala/deprecation-removal
Reviewer Review Type Date Requested Status
Gala developers Pending
Review via email: mp+275591@code.launchpad.net

Description of the change

Changed a lot of functions to post clutter 1.2 way of doing them.

To post a comment you must log in.
Revision history for this message
Rico Tzschichholz (ricotz) wrote :

Unmerged revisions

488. By Corentin Noël

Removed a lot of deprecation warnings.

487. By Corentin Noël

[WindowSwitcher] Replaced deprecated Gravity.

486. By Corentin Noël

Fixed wrong DBus annotation.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/DBus.vala'
2--- src/DBus.vala 2015-03-04 10:50:18 +0000
3+++ src/DBus.vala 2015-10-23 21:59:47 +0000
4@@ -23,7 +23,7 @@
5 static DBus? instance;
6 static WindowManager wm;
7
8- [DBus (visibile = false)]
9+ [DBus (visible = false)]
10 public static void init (WindowManager _wm)
11 {
12 wm = _wm;
13
14=== modified file 'src/Widgets/WindowClone.vala'
15--- src/Widgets/WindowClone.vala 2015-04-11 15:24:55 +0000
16+++ src/Widgets/WindowClone.vala 2015-10-23 21:59:47 +0000
17@@ -447,6 +447,9 @@
18
19 void toggle_shadow (bool show)
20 {
21+ if (get_transition ("shadow-opacity") != null)
22+ remove_transition ("shadow-opacity");
23+
24 var shadow_transition = new PropertyTransition ("shadow-opacity");
25 shadow_transition.duration = MultitaskingView.ANIMATION_DURATION;
26 shadow_transition.remove_on_complete = true;
27
28=== modified file 'src/Widgets/WindowSwitcher.vala'
29--- src/Widgets/WindowSwitcher.vala 2015-06-27 21:04:28 +0000
30+++ src/Widgets/WindowSwitcher.vala 2015-10-23 21:59:47 +0000
31@@ -148,8 +148,6 @@
32
33 var height = icon_size + (top_offset > 0 ? top_offset : 0) + bottom_offset;
34
35- dock.anchor_gravity = horizontal ? Gravity.NORTH : Gravity.WEST;
36-
37 if (horizontal) {
38 dock.height = height;
39 dock.x = Math.ceilf (geometry.x + geometry.width / 2.0f);
40@@ -246,10 +244,12 @@
41
42 if (dock_settings.is_horizontal_dock ()) {
43 dock.width = dock_width;
44+ dock.translation_x = Math.ceilf (-dock_width / 2.0f);
45 dock.get_first_child ().margin_left = items_offset;
46 dock.get_last_child ().margin_right = items_offset;
47 } else {
48 dock.height = dock_width;
49+ dock.translation_y = Math.ceilf (-dock_width / 2.0f);
50 dock.get_first_child ().margin_top = items_offset;
51 dock.get_last_child ().margin_bottom = items_offset;
52 }
53@@ -267,9 +267,11 @@
54 if (dock_settings.is_horizontal_dock ()) {
55 dock.layout_manager.get_preferred_width (dock, dock.height, null, out dest_width);
56 dock.width = dest_width;
57+ dock.translation_x = Math.ceilf (-dest_width / 2.0f);
58 } else {
59 dock.layout_manager.get_preferred_height (dock, dock.width, null, out dest_width);
60 dock.height = dest_width;
61+ dock.translation_y = Math.ceilf (-dest_width / 2.0f);
62 }
63
64 dock.restore_easing_state ();
65@@ -476,10 +478,13 @@
66 dock.set_easing_duration (250);
67 dock.set_easing_mode (AnimationMode.EASE_OUT_CUBIC);
68
69- if (dock_settings.is_horizontal_dock ())
70+ if (dock_settings.is_horizontal_dock ()) {
71 dock.width = dest_width;
72- else
73+ dock.translation_x = Math.ceilf (-dest_width / 2.0f);
74+ } else {
75 dock.height = dest_width;
76+ dock.translation_y = Math.ceilf (-dest_width / 2.0f);
77+ }
78
79 dock.opacity = 0;
80 dock.restore_easing_state ();
81
82=== modified file 'src/Widgets/WorkspaceInsertThumb.vala'
83--- src/Widgets/WorkspaceInsertThumb.vala 2015-03-04 08:36:08 +0000
84+++ src/Widgets/WorkspaceInsertThumb.vala 2015-10-23 21:59:47 +0000
85@@ -39,8 +39,7 @@
86 opacity = 0;
87 set_pivot_point (0.5f, 0.5f);
88 reactive = true;
89-
90- layout_manager = new BinLayout (BinAlignment.CENTER);
91+ x_align = Clutter.ActorAlign.CENTER;
92
93 var drop = new DragDropAction (DragDropActionType.DESTINATION, "multitaskingview-window");
94 drop.crossed.connect ((hovered) => {
95
96=== modified file 'src/WindowManager.vala'
97--- src/WindowManager.vala 2015-09-10 11:32:41 +0000
98+++ src/WindowManager.vala 2015-10-23 21:59:47 +0000
99@@ -767,34 +767,45 @@
100 float scale_y = (float)icon.height / actor.height;
101 float anchor_x = (float)(actor.x - icon.x) * actor.width / (icon.width - actor.width);
102 float anchor_y = (float)(actor.y - icon.y) * actor.height / (icon.height - actor.height);
103-
104- // FIXME set_pivot_point appears to show weird behavior for negative values, which we will need
105- // in some cases. scale_center_{x,y} works fine so far.
106- actor.scale_center_x = anchor_x;
107- actor.scale_center_y = anchor_y;
108-
109- actor.animate (Clutter.AnimationMode.EASE_IN_EXPO, duration,
110- scale_x:scale_x, scale_y:scale_y,opacity:0).completed.connect (() => {
111-
112- actor.scale_center_x = actor.scale_center_y = 0;
113- actor.opacity = 255;
114- actor.scale_x = 1.0;
115- actor.scale_y = 1.0;
116+ actor.set_pivot_point (anchor_x, anchor_y);
117+
118+ actor.save_easing_state ();
119+ actor.set_easing_mode (Clutter.AnimationMode.EASE_IN_EXPO);
120+ actor.set_easing_duration (duration);
121+ actor.scale_x = scale_x;
122+ actor.scale_y = scale_y;
123+ actor.opacity = 0U;
124+ actor.restore_easing_state ();
125+
126+ ulong minimize_handler_id = 0UL;
127+ minimize_handler_id = actor.transitions_completed.connect (() => {
128+ actor.disconnect (minimize_handler_id);
129+ actor.set_pivot_point (0.0f, 0.0f);
130+ actor.opacity = 255U;
131+ actor.scale_x = 1.0f;
132+ actor.scale_y = 1.0f;
133 minimize_completed (actor);
134 minimizing.remove (actor);
135 });
136
137 } else {
138- actor.scale_center_x = width / 2.0f - actor.x;
139- actor.scale_center_y = height - actor.y;
140-
141- actor.animate (Clutter.AnimationMode.EASE_IN_EXPO, duration,
142- scale_x : 0.0f, scale_y : 0.0f, opacity : 0).completed.connect (() => {
143-
144- actor.set_pivot_point (0, 0);
145- actor.opacity = 255;
146- actor.scale_x = 1.0;
147- actor.scale_y = 1.0;
148+ actor.set_pivot_point (width / 2.0f - actor.x, height - actor.y);
149+
150+ actor.save_easing_state ();
151+ actor.set_easing_mode (Clutter.AnimationMode.EASE_IN_EXPO);
152+ actor.set_easing_duration (duration);
153+ actor.scale_x = 0.0f;
154+ actor.scale_y = 0.0f;
155+ actor.opacity = 0U;
156+ actor.restore_easing_state ();
157+
158+ ulong minimize_handler_id = 0UL;
159+ minimize_handler_id = actor.transitions_completed.connect (() => {
160+ actor.disconnect (minimize_handler_id);
161+ actor.set_pivot_point (0.0f, 0.0f);
162+ actor.opacity = 255U;
163+ actor.scale_x = 1.0f;
164+ actor.scale_y = 1.0f;
165 minimize_completed (actor);
166 minimizing.remove (actor);
167 });
168@@ -877,7 +888,7 @@
169
170 maximize_completed (actor);
171
172- actor.scale_gravity = Clutter.Gravity.NORTH_WEST;
173+ actor.set_pivot_point (0.0f, 0.0f);
174 actor.translation_x = old_inner_rect.x - ex;
175 actor.translation_y = old_inner_rect.y - ey;
176 actor.scale_x = 1.0 / scale_x;
177@@ -925,14 +936,22 @@
178
179 unminimizing.add (actor);
180
181- actor.scale_gravity = Clutter.Gravity.SOUTH;
182+ actor.set_pivot_point (0.5f, 1.0f);
183 actor.scale_x = 0.01f;
184 actor.scale_y = 0.1f;
185- actor.opacity = 0;
186- actor.animate (Clutter.AnimationMode.EASE_OUT_EXPO, duration,
187- scale_x:1.0f, scale_y:1.0f, opacity:255)
188- .completed.connect ( () => {
189-
190+ actor.opacity = 0U;
191+
192+ actor.save_easing_state ();
193+ actor.set_easing_mode (Clutter.AnimationMode.EASE_OUT_EXPO);
194+ actor.set_easing_duration (duration);
195+ actor.scale_x = 1.0f;
196+ actor.scale_y = 1.0f;
197+ actor.opacity = 255U;
198+ actor.restore_easing_state ();
199+
200+ ulong unminimize_handler_id = 0UL;
201+ unminimize_handler_id = actor.transitions_completed.connect (() => {
202+ actor.disconnect (unminimize_handler_id);
203 unminimizing.remove (actor);
204 unminimize_completed (actor);
205 });
206@@ -970,14 +989,22 @@
207
208 mapping.add (actor);
209
210- actor.scale_gravity = Clutter.Gravity.SOUTH;
211+ actor.set_pivot_point (0.5f, 1.0f);
212 actor.scale_x = 0.01f;
213 actor.scale_y = 0.1f;
214 actor.opacity = 0;
215- actor.animate (Clutter.AnimationMode.EASE_OUT_EXPO, duration,
216- scale_x:1.0f, scale_y:1.0f, opacity:255)
217- .completed.connect ( () => {
218-
219+
220+ actor.save_easing_state ();
221+ actor.set_easing_mode (Clutter.AnimationMode.EASE_OUT_EXPO);
222+ actor.set_easing_duration (duration);
223+ actor.scale_x = 1.0f;
224+ actor.scale_y = 1.0f;
225+ actor.opacity = 255U;
226+ actor.restore_easing_state ();
227+
228+ ulong map_handler_id = 0UL;
229+ map_handler_id = actor.transitions_completed.connect (() => {
230+ actor.disconnect (map_handler_id);
231 mapping.remove (actor);
232 map_completed (actor);
233 });
234@@ -993,15 +1020,23 @@
235
236 mapping.add (actor);
237
238- actor.scale_gravity = Clutter.Gravity.CENTER;
239- actor.rotation_center_x = {0, 0, 10};
240+ actor.set_pivot_point (0.5f, 0.5f);
241+ actor.set_pivot_point_z (0.2f);
242 actor.scale_x = 0.9f;
243 actor.scale_y = 0.9f;
244 actor.opacity = 0;
245- actor.animate (Clutter.AnimationMode.EASE_OUT_QUAD, duration,
246- scale_x:1.0f, scale_y:1.0f, opacity:255)
247- .completed.connect ( () => {
248-
249+
250+ actor.save_easing_state ();
251+ actor.set_easing_mode (Clutter.AnimationMode.EASE_OUT_QUAD);
252+ actor.set_easing_duration (duration);
253+ actor.scale_x = 1.0f;
254+ actor.scale_y = 1.0f;
255+ actor.opacity = 255U;
256+ actor.restore_easing_state ();
257+
258+ ulong map_handler_id = 0UL;
259+ map_handler_id = actor.transitions_completed.connect (() => {
260+ actor.disconnect (map_handler_id);
261 mapping.remove (actor);
262 map_completed (actor);
263 });
264@@ -1011,13 +1046,21 @@
265
266 mapping.add (actor);
267
268- actor.scale_gravity = Clutter.Gravity.NORTH;
269+ actor.set_pivot_point (0.5f, 0.0f);
270 actor.scale_y = 0.0f;
271 actor.opacity = 0;
272
273- actor.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 250,
274- scale_y:1.0f, opacity:255).completed.connect ( () => {
275+ actor.save_easing_state ();
276+ actor.set_easing_mode (Clutter.AnimationMode.EASE_OUT_QUAD);
277+ actor.set_easing_duration (250);
278+ actor.scale_x = 1.0f;
279+ actor.scale_y = 1.0f;
280+ actor.opacity = 255U;
281+ actor.restore_easing_state ();
282
283+ ulong map_handler_id = 0UL;
284+ map_handler_id = actor.transitions_completed.connect (() => {
285+ actor.disconnect (map_handler_id);
286 mapping.remove (actor);
287 map_completed (actor);
288 });
289@@ -1061,12 +1104,20 @@
290
291 destroying.add (actor);
292
293- actor.scale_gravity = Clutter.Gravity.CENTER;
294+ actor.set_pivot_point (0.5f, 0.5f);
295 actor.show ();
296- actor.animate (Clutter.AnimationMode.LINEAR, duration,
297- scale_x:0.8f, scale_y:0.8f, opacity:0)
298- .completed.connect ( () => {
299-
300+
301+ actor.save_easing_state ();
302+ actor.set_easing_mode (Clutter.AnimationMode.LINEAR);
303+ actor.set_easing_duration (duration);
304+ actor.scale_x = 0.8f;
305+ actor.scale_y = 0.8f;
306+ actor.opacity = 0U;
307+ actor.restore_easing_state ();
308+
309+ ulong destroy_handler_id = 0UL;
310+ destroy_handler_id = actor.transitions_completed.connect (() => {
311+ actor.disconnect (destroy_handler_id);
312 destroying.remove (actor);
313 destroy_completed (actor);
314 Utils.request_clean_icon_cache (get_all_xids ());
315@@ -1076,10 +1127,17 @@
316 case WindowType.DIALOG:
317 destroying.add (actor);
318
319- actor.scale_gravity = Clutter.Gravity.NORTH;
320- actor.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 200,
321- scale_y:0.0f, opacity:0).completed.connect ( () => {
322+ actor.set_pivot_point (0.5f, 0.0f);
323+ actor.save_easing_state ();
324+ actor.set_easing_mode (Clutter.AnimationMode.EASE_OUT_QUAD);
325+ actor.set_easing_duration (200);
326+ actor.scale_y = 0.0f;
327+ actor.opacity = 0U;
328+ actor.restore_easing_state ();
329
330+ ulong destroy_handler_id = 0UL;
331+ destroy_handler_id = actor.transitions_completed.connect (() => {
332+ actor.disconnect (destroy_handler_id);
333 destroying.remove (actor);
334 destroy_completed (actor);
335 });
336@@ -1097,11 +1155,17 @@
337 }
338
339 destroying.add (actor);
340-
341- actor.animate (Clutter.AnimationMode.EASE_OUT_QUAD, duration,
342- scale_x:0.8f, scale_y:0.8f, opacity:0)
343- .completed.connect ( () => {
344-
345+ actor.save_easing_state ();
346+ actor.set_easing_mode (Clutter.AnimationMode.EASE_OUT_QUAD);
347+ actor.set_easing_duration (duration);
348+ actor.scale_x = 0.8f;
349+ actor.scale_y = 0.8f;
350+ actor.opacity = 0U;
351+ actor.restore_easing_state ();
352+
353+ ulong destroy_handler_id = 0UL;
354+ destroy_handler_id = actor.transitions_completed.connect (() => {
355+ actor.disconnect (destroy_handler_id);
356 destroying.remove (actor);
357 destroy_completed (actor);
358 });
359@@ -1154,34 +1218,44 @@
360
361 ui_group.add_child (old_actor);
362
363- var scale_x = (double) (ew - offset_width) / old_rect.width;
364- var scale_y = (double) (eh - offset_height) / old_rect.height;
365-
366- old_actor.animate (Clutter.AnimationMode.EASE_IN_OUT_QUAD, duration,
367- x: (ex - offset_x),
368- y: (ey - offset_y),
369- opacity: 0,
370- scale_x: scale_x,
371- scale_y: scale_y).completed.connect (() => {
372+ var scale_x = (float) (ew - offset_width) / old_rect.width;
373+ var scale_y = (float) (eh - offset_height) / old_rect.height;
374+
375+ old_actor.save_easing_state ();
376+ old_actor.set_easing_mode (Clutter.AnimationMode.EASE_IN_OUT_QUAD);
377+ old_actor.set_easing_duration (duration);
378+ old_actor.x = ex - offset_x;
379+ old_actor.y = ey - offset_y;
380+ old_actor.scale_x = scale_x;
381+ old_actor.scale_y = scale_y;
382+ old_actor.opacity = 0U;
383+ old_actor.restore_easing_state ();
384+
385+ ulong unmaximize_old_handler_id = 0UL;
386+ unmaximize_old_handler_id = old_actor.transitions_completed.connect (() => {
387+ old_actor.disconnect (unmaximize_old_handler_id);
388 old_actor.destroy ();
389 });
390
391 var maximized_x = actor.x;
392 var maximized_y = actor.y;
393 unmaximize_completed (actor);
394- actor.scale_gravity = Clutter.Gravity.NORTH_WEST;
395+ actor.set_pivot_point (0.0f, 0.0f);
396 actor.x = ex;
397 actor.y = ey;
398- actor.translation_x = -ex + offset_x * (float) (1.0 / scale_x) + maximized_x;
399- actor.translation_y = -ey + offset_y * (float) (1.0 / scale_y) + maximized_y;
400- actor.scale_x = 1.0 / scale_x;
401- actor.scale_y = 1.0 / scale_y;
402+ actor.translation_x = -ex + offset_x * (1.0f / scale_x) + maximized_x;
403+ actor.translation_y = -ey + offset_y * (1.0f / scale_y) + maximized_y;
404+ actor.scale_x = 1.0f / scale_x;
405+ actor.scale_y = 1.0f / scale_y;
406
407- actor.animate (Clutter.AnimationMode.EASE_IN_OUT_QUAD, duration,
408- scale_x: 1.0,
409- scale_y: 1.0,
410- translation_x: 0.0,
411- translation_y: 0.0);
412+ actor.save_easing_state ();
413+ actor.set_easing_mode (Clutter.AnimationMode.EASE_IN_OUT_QUAD);
414+ actor.set_easing_duration (duration);
415+ actor.scale_x = 1.0f;
416+ actor.scale_y = 1.0f;
417+ actor.translation_x = 0.0f;
418+ actor.translation_y = 0.0f;
419+ actor.restore_easing_state ();
420
421 return;
422 }
423@@ -1202,12 +1276,11 @@
424 }
425
426 actor.detach_animation ();
427- actor.opacity = 255;
428+ actor.opacity = 255U;
429 actor.scale_x = 1.0f;
430 actor.scale_y = 1.0f;
431 actor.rotation_angle_x = 0.0f;
432- actor.anchor_gravity = Clutter.Gravity.NORTH_WEST;
433- actor.scale_gravity = Clutter.Gravity.NORTH_WEST;
434+ actor.set_pivot_point (0.0f, 0.0f);
435
436 list.remove (actor);
437 return true;
438@@ -1261,8 +1334,8 @@
439 var primary = screen.get_primary_monitor ();
440 var move_primary_only = InternalUtils.workspaces_only_on_primary ();
441 var monitor_geom = screen.get_monitor_geometry (primary);
442- var clone_offset_x = move_primary_only ? monitor_geom.x : 0;
443- var clone_offset_y = move_primary_only ? monitor_geom.y : 0;
444+ var clone_offset_x = move_primary_only ? monitor_geom.x : 0.0f;
445+ var clone_offset_y = move_primary_only ? monitor_geom.y : 0.0f;
446
447 screen.get_size (out screen_width, out screen_height);
448
449@@ -1391,15 +1464,15 @@
450 if (!from_has_fullscreened) {
451 windows.prepend (window);
452 parents.prepend (window.get_parent ());
453- window.set_translation (-clone_offset_x, -clone_offset_y, 0);
454+ window.set_translation (-clone_offset_x, -clone_offset_y, 0.0f);
455
456 clutter_actor_reparent (window, out_group);
457 }
458 }
459
460 main_container.clip_to_allocation = true;
461- main_container.x = move_primary_only ? monitor_geom.x : 0;
462- main_container.y = move_primary_only ? monitor_geom.y : 0;
463+ main_container.x = move_primary_only ? monitor_geom.x : 0.0f;
464+ main_container.y = move_primary_only ? monitor_geom.y : 0.0f;
465 main_container.width = move_primary_only ? monitor_geom.width : screen_width;
466 main_container.height = move_primary_only ? monitor_geom.height : screen_height;
467
468@@ -1407,8 +1480,8 @@
469 if (direction == MotionDirection.RIGHT)
470 x2 = -x2;
471
472- out_group.x = 0;
473- wallpaper.x = 0;
474+ out_group.x = 0.0f;
475+ wallpaper.x = 0.0f;
476 in_group.x = -x2;
477 wallpaper_clone.x = -x2;
478
479@@ -1430,10 +1503,10 @@
480 wallpaper.set_easing_duration (animation_duration);
481
482 out_group.x = x2;
483- in_group.x = 0;
484+ in_group.x = 0.0f;
485
486 wallpaper.x = x2;
487- wallpaper_clone.x = 0;
488+ wallpaper_clone.x = 0.0f;
489 wallpaper.restore_easing_state ();
490
491 var transition = in_group.get_transition ("x");
492@@ -1453,7 +1526,7 @@
493
494 for (var i = 0; i < windows.length (); i++) {
495 var actor = windows.nth_data (i);
496- actor.set_translation (0, 0, 0);
497+ actor.set_translation (0.0f, 0.0f, 0.0f);
498
499 // to maintain the correct order of monitor, we need to insert the Background
500 // back manually
501@@ -1498,10 +1571,10 @@
502 window.hide ();
503
504 // some static windows may have been faded out
505- if (actor.opacity < 255) {
506+ if (actor.opacity < 255U) {
507 actor.save_easing_state ();
508 actor.set_easing_duration (300);
509- actor.opacity = 255;
510+ actor.opacity = 255U;
511 actor.restore_easing_state ();
512 }
513 }

Subscribers

People subscribed via source and target branches