diff -Nru gnome-shell-extension-ubuntu-dock-70~ubuntu2/debian/changelog gnome-shell-extension-ubuntu-dock-70~ubuntu3/debian/changelog --- gnome-shell-extension-ubuntu-dock-70~ubuntu2/debian/changelog 2021-08-26 18:04:01.000000000 +0000 +++ gnome-shell-extension-ubuntu-dock-70~ubuntu3/debian/changelog 2021-09-07 10:18:14.000000000 +0000 @@ -1,3 +1,11 @@ +gnome-shell-extension-ubuntu-dock (70~ubuntu3) impish; urgency=medium + + [ Daniel van Vugt ] + * docking: Generalize the startup animation + - Applied addition to upstream PR #1512 (LP: #1942843). + + -- Gunnar Hjalmarsson Tue, 07 Sep 2021 12:18:14 +0200 + gnome-shell-extension-ubuntu-dock (70~ubuntu2) impish; urgency=medium [ Daniel van Vugt ] diff -Nru gnome-shell-extension-ubuntu-dock-70~ubuntu2/docking.js gnome-shell-extension-ubuntu-dock-70~ubuntu3/docking.js --- gnome-shell-extension-ubuntu-dock-70~ubuntu2/docking.js 2021-07-07 07:22:12.000000000 +0000 +++ gnome-shell-extension-ubuntu-dock-70~ubuntu3/docking.js 2021-09-07 10:11:30.000000000 +0000 @@ -1867,6 +1867,48 @@ this.emit('docks-ready'); } + _prepareStartupAnimation() { + DockManager.allDocks.forEach(dock => { + const { dash } = dock; + + dash.set({ + opacity: 0, + translation_x: 0, + translation_y: 0, + }); + }); + } + + _runStartupAnimation() { + DockManager.allDocks.forEach(dock => { + const { dash } = dock; + + switch (dock.position) { + case St.Side.LEFT: + dash.translation_x = -dash.width; + break; + case St.Side.RIGHT: + dash.translation_x = dash.width; + break; + case St.Side.BOTTOM: + dash.translation_y = dash.height; + break; + case St.Side.TOP: + dash.translation_y = -dash.height; + break; + } + + const { STARTUP_ANIMATION_TIME } = Layout; + dash.ease({ + opacity: 255, + translation_x: 0, + translation_y: 0, + duration: STARTUP_ANIMATION_TIME, + mode: Clutter.AnimationMode.EASE_OUT_QUAD, + }); + }); + } + _prepareMainDash() { // Ensure Main.overview.dash is set to our dash in dummy mode // while just use the default getter otherwise. @@ -1924,69 +1966,15 @@ const { ControlsManager, ControlsManagerLayout } = OverviewControls; - this._methodInjections.addWithLabel('main-dash', ControlsManager.prototype, - 'runStartupAnimation', async function (originalMethod, callback) { - const injections = new Utils.InjectionsHandler(); - DockManager.allDocks.forEach(dock => (dock.opacity = 0)); - injections.add(DockManager.getDefault().mainDock.dash, 'ease', () => {}); - let callbackArgs = []; - const ret = await originalMethod.call(this, - (...args) => (callbackArgs = [...args])); - injections.destroy(); - - if (!DockManager.allDocks.length) { - // Docks may have been destroyed, let's wait till we've one again - const readyPromise = new Promise(resolve => { - const id = DockManager.getDefault().connect('docks-ready', () => { - DockManager.getDefault().disconnect(id); - resolve(); - }); - }) - await readyPromise; - } - - DockManager.allDocks.forEach(dock => { - const { dash } = dock; - - dash.set({ - opacity: 0, - translation_x: 0, - translation_y: 0, - }); - dock.opacity = 255; - - switch (dock.position) { - case St.Side.LEFT: - dash.translation_x = -dash.width; - break; - case St.Side.RIGHT: - dash.translation_x = dash.width; - break; - case St.Side.BOTTOM: - dash.translation_y = dash.height; - break; - case St.Side.TOP: - dash.translation_y = -dash.height; - break; - } - - const mainDockProperties = {}; - if (dock === DockManager.getDefault().mainDock) - mainDockProperties.onComplete = callback(...callbackArgs); - - const { STARTUP_ANIMATION_TIME } = Layout; - dash.ease({ - opacity: 255, - translation_x: 0, - translation_y: 0, - delay: STARTUP_ANIMATION_TIME, - duration: STARTUP_ANIMATION_TIME, - mode: Clutter.AnimationMode.EASE_OUT_QUAD, - ...mainDockProperties, - }); - }); - return ret; + this._prepareStartupAnimation(); + if (Main.layoutManager._startingUp) { + let id = Main.layoutManager.connect('startup-complete', () => { + this._runStartupAnimation(); + Main.layoutManager.disconnect(id); }); + } else { + this._runStartupAnimation(); + } const maybeAdjustBoxToDock = box => { if (this.mainDock.isHorizontal || this.settings.dockFixed)