From 7ada79f6d95a1487f40351263e3aaba92f0ff62c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 1 Mar 2023 20:39:00 +0100 Subject: [PATCH] iconGrid: Delay updating adjustment value on page switch When switching to a newly created page, the adjustment's limits haven't been adjusted yet. As a result, setting the new value only works when the transition is animated. To fix the non-animated case, use a MetaLater to set the adjustment value. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6315 Part-of: --- js/ui/iconGrid.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js index 523237782..01d57e0fc 100644 --- a/js/ui/iconGrid.js +++ b/js/ui/iconGrid.js @@ -1349,10 +1349,14 @@ var IconGrid = GObject.registerClass({ if (!this.mapped) animate = false; - adjustment.ease(newValue, { - mode: Clutter.AnimationMode.EASE_OUT_CUBIC, - duration: animate ? PAGE_SWITCH_TIME : 0, - }); + global.compositor.get_laters().add( + Meta.LaterType.BEFORE_REDRAW, () => { + adjustment.ease(newValue, { + mode: Clutter.AnimationMode.EASE_OUT_CUBIC, + duration: animate ? PAGE_SWITCH_TIME : 0, + }); + return GLib.SOURCE_REMOVE; + }); } /**