Fix 3.36 grid icon positions

This commit is contained in:
Charles Gagnon
2020-04-07 17:04:03 -04:00
parent 3e9cf871ef
commit 3c294ec3e2
2 changed files with 42 additions and 12 deletions

View File

@@ -1098,19 +1098,12 @@ var taskbar = Utils.defineClass({
if (!Main.overview._shown) {
this.forcedOverview = true;
let grid = Main.overview.viewSelector.appDisplay._views[visibleView].view._grid;
let onShownCbs = [];
let onShownCb;
let overviewShownId = Main.overview.connect('shown', () => {
Main.overview.disconnect(overviewShownId);
onShownCbs.forEach(cb => cb());
onShownCb();
});
if (Config.PACKAGE_VERSION > '3.35.9') {
let animateIconPosition = IconGrid.animateIconPosition;
IconGrid.animateIconPosition = (icon, box, flags, nChangedIcons) => icon.allocate(box, flags);
onShownCbs.push(() => IconGrid.animateIconPosition = animateIconPosition);
}
if (animate) {
// Animate in the the appview, hide the appGrid to avoiud flashing
// Go to the appView before entering the overview, skipping the workspaces.
@@ -1126,13 +1119,14 @@ var taskbar = Utils.defineClass({
// and the appgrid could already be allocated from previous shown.
// It has to be triggered after the overview is shown as wrong coordinates are obtained
// otherwise.
onShownCbs.push(() => Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => {
onShownCb = () => Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => {
grid.actor.opacity = 255;
grid.animateSpring(IconGrid.AnimationDirection.IN, this.showAppsButton);
}));
});
} else {
Main.overview.viewSelector._activePage = Main.overview.viewSelector._appsPage;
Main.overview.viewSelector._activePage.show();
onShownCb = () => grid.emit('animation-done');
}
}