workspacesView/workspacesDisplay: Don't sync geometry when animating

Synchronizing the actual geometry while animating from / to the overview can
break the animation. Let's prevent that. This code will go away soon anyway,
but to not lose bisectability, it's better not to leave it misbehaving until
then.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1613>
This commit is contained in:
Georges Basile Stavracas Neto 2020-12-30 19:59:02 -03:00 committed by Marge Bot
parent ed1170906b
commit b64103efca

View File

@ -515,6 +515,7 @@ class WorkspacesDisplay extends St.Widget {
this._gestureActive = false; // touch(pad) gestures this._gestureActive = false; // touch(pad) gestures
this._canScroll = true; // limiting scrolling speed this._canScroll = true; // limiting scrolling speed
this._animating = false;
this.connect('destroy', this._onDestroy.bind(this)); this.connect('destroy', this._onDestroy.bind(this));
} }
@ -690,6 +691,8 @@ class WorkspacesDisplay extends St.Widget {
} }
animateFromOverview() { animateFromOverview() {
this._animating = true;
for (let i = 0; i < this._workspacesViews.length; i++) for (let i = 0; i < this._workspacesViews.length; i++)
this._workspacesViews[i].animateFromOverview(); this._workspacesViews[i].animateFromOverview();
@ -703,10 +706,13 @@ class WorkspacesDisplay extends St.Widget {
x, y, width, height, x, y, width, height,
duration: ANIMATION_TIME, duration: ANIMATION_TIME,
mode: Clutter.AnimationMode.EASE_OUT_QUAD, mode: Clutter.AnimationMode.EASE_OUT_QUAD,
onStopped: () => (this._animating = false),
}); });
} }
vfunc_hide() { vfunc_hide() {
this._animating = false;
if (this._restackedNotifyId > 0) { if (this._restackedNotifyId > 0) {
Main.overview.disconnect(this._restackedNotifyId); Main.overview.disconnect(this._restackedNotifyId);
this._restackedNotifyId = 0; this._restackedNotifyId = 0;
@ -739,6 +745,8 @@ class WorkspacesDisplay extends St.Widget {
} }
_updateWorkspacesViews() { _updateWorkspacesViews() {
this._animating = false;
for (let i = 0; i < this._workspacesViews.length; i++) for (let i = 0; i < this._workspacesViews.length; i++)
this._workspacesViews[i].destroy(); this._workspacesViews[i].destroy();
@ -815,6 +823,9 @@ class WorkspacesDisplay extends St.Widget {
this._syncActualGeometryLater = this._syncActualGeometryLater =
Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => { Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => {
if (this._animating)
return GLib.SOURCE_CONTINUE;
this._syncWorkspacesActualGeometry(); this._syncWorkspacesActualGeometry();
this._syncActualGeometryLater = 0; this._syncActualGeometryLater = 0;