[gnome-shell] Revert "workspace: Animate window clones using translation properties"



commit 25985868e8ab998e2c5427d1f6c3122bf3b2922d
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Sat May 30 15:23:41 2020 +0200

    Revert "workspace: Animate window clones using translation properties"
    
    We're going to add a ClutterLayoutManager responsible for allocating the
    WindowClones. Since layout managers should only set the allocation of
    actors, not the translation or scale, we need to position the
    WindowClones using their x, y, width and height properties.
    
    The first step for this is to revert this commit, which switched from
    setting fixed positions on WindowClones to using the translation
    properties.
    
    This reverts commit 8929c89d1fbbdd7b150b3d46b485b2db732cfb00.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1294

 js/ui/workspace.js | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index e11ffd8966..0830e29fb9 100644
--- a/js/ui/workspace.js
+++ b/js/ui/workspace.js
@@ -154,7 +154,8 @@ var WindowClone = GObject.registerClass({
 
         this._updateAttachedDialogs();
         this._computeBoundingBox();
-        this.set_translation(this._boundingBox.x, this._boundingBox.y, 0);
+        this.x = this._boundingBox.x;
+        this.y = this._boundingBox.y;
 
         this._computeWindowCenter();
 
@@ -1367,8 +1368,8 @@ class Workspace extends St.Widget {
             if (!clone.positioned) {
                 // This window appeared after the overview was already up
                 // Grow the clone from the center of the slot
-                clone.translation_x = x + cloneWidth / 2;
-                clone.translation_y = y + cloneHeight / 2;
+                clone.x = x + cloneWidth / 2;
+                clone.y = y + cloneHeight / 2;
                 clone.scale_x = 0;
                 clone.scale_y = 0;
                 clone.positioned = true;
@@ -1383,8 +1384,8 @@ class Workspace extends St.Widget {
                         clone.opacity = 0;
                         clone.scale_x = 0;
                         clone.scale_y = 0;
-                        clone.translation_x = x;
-                        clone.translation_y = y;
+                        clone.x = x;
+                        clone.y = y;
                     }
 
                     clone.ease({
@@ -1398,7 +1399,7 @@ class Workspace extends St.Widget {
             } else {
                 // cancel any active tweens (otherwise they might override our changes)
                 clone.remove_all_transitions();
-                clone.set_translation(x, y, 0);
+                clone.set_position(x, y);
                 clone.set_scale(scale, scale);
                 clone.set_opacity(255);
                 clone.overlay.relayout(false);
@@ -1428,8 +1429,7 @@ class Workspace extends St.Widget {
 
     _animateClone(clone, overlay, x, y, scale) {
         clone.ease({
-            translation_x: x,
-            translation_y: y,
+            x, y,
             scale_x: scale,
             scale_y: scale,
             duration: Overview.ANIMATION_TIME,
@@ -1574,7 +1574,7 @@ class Workspace extends St.Widget {
             clone.slot = [x, y, clone.width * scale, clone.height * scale];
             clone.positioned = true;
 
-            clone.set_translation(x, y, 0);
+            clone.set_position(x, y);
             clone.set_scale(scale, scale);
             clone.overlay.relayout(false);
         }
@@ -1729,8 +1729,8 @@ class Workspace extends St.Widget {
             let [origX, origY] = clone.getOriginalPosition();
             clone.scale_x = 1;
             clone.scale_y = 1;
-            clone.translation_x = origX;
-            clone.translation_y = origY;
+            clone.x = origX;
+            clone.y = origY;
             clone.ease({
                 opacity,
                 duration,
@@ -1780,8 +1780,8 @@ class Workspace extends St.Widget {
         if (clone.metaWindow.showing_on_its_workspace()) {
             let [origX, origY] = clone.getOriginalPosition();
             clone.ease({
-                translation_x: origX,
-                translation_y: origY,
+                x: origX,
+                y: origY,
                 scale_x: 1,
                 scale_y: 1,
                 opacity: 255,


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