From bcbd081521726d4239b9dcd06098d448651258a7 Mon Sep 17 00:00:00 2001 From: H09-0 Date: Thu, 28 May 2026 15:59:29 +0300 Subject: [PATCH] Fix menu misalignment on first open after login - Add _calculatePosition() + set_position() in onComplete of the animation path to ensure the menu snaps to the correct position immediately after the visual transition finishes. Without this, _allocationChanged is blocked by this.animating during the animation, so any deferred layout changes (e.g. app buttons shown via Mainloop.idle_add) cannot correct the position until after the animation ends and the next allocation change fires. - Replace separate this.actor.x / this.actor.y assignments with this.actor.set_position() in the non-animation path to avoid a race where setting x triggers _allocationChanged synchronously, which calls set_position(), and then the subsequent y assignment overwrites the corrected Y coordinate with the stale value. Closes https://github.com/linuxmint/cinnamon/issues/13780 --- js/ui/popupMenu.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index 34f2cc130f..6ee9d08066 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -1858,6 +1858,8 @@ var PopupMenu = class PopupMenu extends PopupMenuBase { opacity: 255, onComplete: () => { this.animating = false; + let [xPos, yPos] = this._calculatePosition(); + this.actor.set_position(xPos, yPos); } } @@ -1891,8 +1893,7 @@ var PopupMenu = class PopupMenu extends PopupMenuBase { this.animating = false; let [xPos, yPos] = this._calculatePosition(); // should this be conditional on this._slidePosition being -1? - this.actor.x = xPos; - this.actor.y = yPos; + this.actor.set_position(xPos, yPos); this.actor.show(); }