[gnome-shell/wip/exalm/gestures: 19/22] workspaceAnimation: Only create moving window bin when needed



commit 1fd72da4679876a57576801dc973610686efe06b
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Fri Jul 5 15:48:38 2019 +0500

    workspaceAnimation: Only create moving window bin when needed
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/605

 js/ui/workspaceAnimation.js | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/js/ui/workspaceAnimation.js b/js/ui/workspaceAnimation.js
index 2b2713c32..47a933215 100644
--- a/js/ui/workspaceAnimation.js
+++ b/js/ui/workspaceAnimation.js
@@ -84,14 +84,12 @@ class WorkspaceGroup extends Clutter.Actor {
 var WorkspaceAnimation = class {
     constructor(controller, from, to, direction) {
         this._controller = controller;
-        this._movingWindowBin = new Clutter.Actor();
         this._movingWindow = null;
         this._surroundings = {};
         this._progress = 0;
 
         this._container = new Clutter.Actor();
 
-        global.window_group.add_actor(this._movingWindowBin);
         global.window_group.add_actor(this._container);
 
         let workspaceManager = global.workspace_manager;
@@ -125,18 +123,22 @@ var WorkspaceAnimation = class {
             info.actor.set_position(x, y);
         }
 
-        this._movingWindowBin.raise_top();
-
         if (this._controller.movingWindow) {
             let actor = this._controller.movingWindow.get_compositor_private();
+            let container = new Clutter.Actor();
 
-            this._movingWindow = { window: actor,
+            this._movingWindow = { container: container,
+                                   window: actor,
                                    parent: actor.get_parent() };
 
-            actor.reparent(this._movingWindowBin);
+            actor.reparent(this._movingWindow.container);
             this._movingWindow.windowDestroyId = actor.connect('destroy', () => {
                 this._movingWindow = null;
             });
+
+            global.window_group.add_actor(container);
+
+            container.raise_top();
         }
     }
 
@@ -145,12 +147,12 @@ var WorkspaceAnimation = class {
             let record = this._movingWindow;
             record.window.disconnect(record.windowDestroyId);
             record.window.reparent(record.parent);
+            record.container.destroy();
 
             this._movingWindow = null;
         }
 
         this._container.destroy();
-        this._movingWindowBin.destroy();
     }
 
     _getPositionForDirection(direction, fromWs, toWs) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]