From 31c584e7d1417a5c7236bef7acf6a01bfcfa7687 Mon Sep 17 00:00:00 2001 From: rope Date: Tue, 28 Jul 2026 15:10:55 +0100 Subject: [PATCH] quickshell: close the tray-to-tray morph gap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gating the held height on the model alone was not enough. The model populating and the layout catching up are different frames: the Repeater still has to build delegates and the Column re-measure, so menuLoaded went true while the Card was still empty-sized and the panel collapsed for a frame before regrowing. Only tray-to-tray showed it, because that is the one path that reassigns the menu handle — coming from a non-tray widget leaves the handle unchanged, so nothing reloads. menuReady now also requires the height to have grown past an empty Card (2*cardPad = 16; the smallest real row is 28, so it cannot misfire). Co-Authored-By: Claude Opus 5 --- settings/quickshell.nix | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/settings/quickshell.nix b/settings/quickshell.nix index a75cb83..55c5e47 100644 --- a/settings/quickshell.nix +++ b/settings/quickshell.nix @@ -2118,15 +2118,26 @@ in // small, and nil when it is the same menu as last time. readonly property bool menuLoaded: menuOpener.children && menuOpener.children.values.length > 0 + // The model populating is NOT the same instant as the + // layout catching up: the Repeater still has to build its + // delegates and the Column re-measure. Gating on the model + // alone left a frame where menuLoaded was true but the Card + // was still empty-sized, so the panel collapsed and then + // regrew — visible when switching between two tray icons, + // which is the only path that reassigns the handle. + // Require the height to have actually grown past an empty + // Card (which measures 2*cardPad, not 0). + readonly property bool menuReady: + menuLoaded && menuItems.height > 2 * Theme.cardPad property real lastMenuHeight: 0 - fullHeight: (menuLoaded ? menuItems.height - : Math.max(menuItems.height, lastMenuHeight)) + fullHeight: (menuReady ? menuItems.height + : Math.max(menuItems.height, lastMenuHeight)) + 2 * Theme.panelGap Connections { target: menuItems function onHeightChanged() { - if (contextMenu.menuLoaded) + if (contextMenu.menuReady) contextMenu.lastMenuHeight = menuItems.height; } }