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 8929c89d1f
.
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1294
This commit is contained in:
parent
393c6c6805
commit
25985868e8
@ -154,7 +154,8 @@ var WindowClone = GObject.registerClass({
|
|||||||
|
|
||||||
this._updateAttachedDialogs();
|
this._updateAttachedDialogs();
|
||||||
this._computeBoundingBox();
|
this._computeBoundingBox();
|
||||||
this.set_translation(this._boundingBox.x, this._boundingBox.y, 0);
|
this.x = this._boundingBox.x;
|
||||||
|
this.y = this._boundingBox.y;
|
||||||
|
|
||||||
this._computeWindowCenter();
|
this._computeWindowCenter();
|
||||||
|
|
||||||
@ -1367,8 +1368,8 @@ class Workspace extends St.Widget {
|
|||||||
if (!clone.positioned) {
|
if (!clone.positioned) {
|
||||||
// This window appeared after the overview was already up
|
// This window appeared after the overview was already up
|
||||||
// Grow the clone from the center of the slot
|
// Grow the clone from the center of the slot
|
||||||
clone.translation_x = x + cloneWidth / 2;
|
clone.x = x + cloneWidth / 2;
|
||||||
clone.translation_y = y + cloneHeight / 2;
|
clone.y = y + cloneHeight / 2;
|
||||||
clone.scale_x = 0;
|
clone.scale_x = 0;
|
||||||
clone.scale_y = 0;
|
clone.scale_y = 0;
|
||||||
clone.positioned = true;
|
clone.positioned = true;
|
||||||
@ -1383,8 +1384,8 @@ class Workspace extends St.Widget {
|
|||||||
clone.opacity = 0;
|
clone.opacity = 0;
|
||||||
clone.scale_x = 0;
|
clone.scale_x = 0;
|
||||||
clone.scale_y = 0;
|
clone.scale_y = 0;
|
||||||
clone.translation_x = x;
|
clone.x = x;
|
||||||
clone.translation_y = y;
|
clone.y = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
clone.ease({
|
clone.ease({
|
||||||
@ -1398,7 +1399,7 @@ class Workspace extends St.Widget {
|
|||||||
} else {
|
} else {
|
||||||
// cancel any active tweens (otherwise they might override our changes)
|
// cancel any active tweens (otherwise they might override our changes)
|
||||||
clone.remove_all_transitions();
|
clone.remove_all_transitions();
|
||||||
clone.set_translation(x, y, 0);
|
clone.set_position(x, y);
|
||||||
clone.set_scale(scale, scale);
|
clone.set_scale(scale, scale);
|
||||||
clone.set_opacity(255);
|
clone.set_opacity(255);
|
||||||
clone.overlay.relayout(false);
|
clone.overlay.relayout(false);
|
||||||
@ -1428,8 +1429,7 @@ class Workspace extends St.Widget {
|
|||||||
|
|
||||||
_animateClone(clone, overlay, x, y, scale) {
|
_animateClone(clone, overlay, x, y, scale) {
|
||||||
clone.ease({
|
clone.ease({
|
||||||
translation_x: x,
|
x, y,
|
||||||
translation_y: y,
|
|
||||||
scale_x: scale,
|
scale_x: scale,
|
||||||
scale_y: scale,
|
scale_y: scale,
|
||||||
duration: Overview.ANIMATION_TIME,
|
duration: Overview.ANIMATION_TIME,
|
||||||
@ -1574,7 +1574,7 @@ class Workspace extends St.Widget {
|
|||||||
clone.slot = [x, y, clone.width * scale, clone.height * scale];
|
clone.slot = [x, y, clone.width * scale, clone.height * scale];
|
||||||
clone.positioned = true;
|
clone.positioned = true;
|
||||||
|
|
||||||
clone.set_translation(x, y, 0);
|
clone.set_position(x, y);
|
||||||
clone.set_scale(scale, scale);
|
clone.set_scale(scale, scale);
|
||||||
clone.overlay.relayout(false);
|
clone.overlay.relayout(false);
|
||||||
}
|
}
|
||||||
@ -1729,8 +1729,8 @@ class Workspace extends St.Widget {
|
|||||||
let [origX, origY] = clone.getOriginalPosition();
|
let [origX, origY] = clone.getOriginalPosition();
|
||||||
clone.scale_x = 1;
|
clone.scale_x = 1;
|
||||||
clone.scale_y = 1;
|
clone.scale_y = 1;
|
||||||
clone.translation_x = origX;
|
clone.x = origX;
|
||||||
clone.translation_y = origY;
|
clone.y = origY;
|
||||||
clone.ease({
|
clone.ease({
|
||||||
opacity,
|
opacity,
|
||||||
duration,
|
duration,
|
||||||
@ -1780,8 +1780,8 @@ class Workspace extends St.Widget {
|
|||||||
if (clone.metaWindow.showing_on_its_workspace()) {
|
if (clone.metaWindow.showing_on_its_workspace()) {
|
||||||
let [origX, origY] = clone.getOriginalPosition();
|
let [origX, origY] = clone.getOriginalPosition();
|
||||||
clone.ease({
|
clone.ease({
|
||||||
translation_x: origX,
|
x: origX,
|
||||||
translation_y: origY,
|
y: origY,
|
||||||
scale_x: 1,
|
scale_x: 1,
|
||||||
scale_y: 1,
|
scale_y: 1,
|
||||||
opacity: 255,
|
opacity: 255,
|
||||||
|
Loading…
Reference in New Issue
Block a user