From 7d6a7bae0663561faf3dd85696ea0673728621fa Mon Sep 17 00:00:00 2001 From: bbedward Date: Fri, 17 Jul 2026 09:17:00 -0400 Subject: [PATCH] bar: fix bar order-creation regression caused by async loading port 1.5 (cherry picked from commit 95e1d6b72eaa878fe550d2c0f2252373a86b2cb4) --- quickshell/ShellCore.qml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/quickshell/ShellCore.qml b/quickshell/ShellCore.qml index cdf62d3f5..6dcfcc2aa 100644 --- a/quickshell/ShellCore.qml +++ b/quickshell/ShellCore.qml @@ -116,12 +116,28 @@ Item { property var hyprlandOverviewLoaderRef: hyprlandOverviewLoader + // Horizontal bars must claim their exclusive zones first, so vertical bars wait for every enabled horizontal bar to load + readonly property int horizontalWanted: SettingsData.barConfigs.filter(c => (c.enabled ?? false) && c.position !== SettingsData.Position.Left && c.position !== SettingsData.Position.Right).length + property int horizontalReady: 0 + + function recountHorizontalReady() { + let ready = 0; + for (let i = 0; i < count; i++) { + const loader = itemAt(i); + if (loader?.item && !loader.isVertical) + ready++; + } + horizontalReady = ready; + } + delegate: Loader { id: barLoader required property var modelData property var barConfig: SettingsData.barConfigs.find(cfg => cfg.id === modelData.id) || null - active: root.barSurfacesLoaded && (barConfig?.enabled ?? false) + readonly property bool isVertical: modelData.position === SettingsData.Position.Left || modelData.position === SettingsData.Position.Right + active: root.barSurfacesLoaded && (barConfig?.enabled ?? false) && (!isVertical || dankBarRepeater.horizontalReady >= dankBarRepeater.horizontalWanted) asynchronous: false + onItemChanged: dankBarRepeater.recountHorizontalReady() sourceComponent: DankBar { barConfig: barLoader.barConfig