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; } }