From 26c1e62204f6bd690c2de1816d82ffa5af4a3a7c Mon Sep 17 00:00:00 2001 From: bbedward Date: Tue, 10 Mar 2026 11:47:30 -0400 Subject: [PATCH] fix(dankbar): use ID as tie breaker --- quickshell/DMSShell.qml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/quickshell/DMSShell.qml b/quickshell/DMSShell.qml index 4c853766..da4fc64c 100644 --- a/quickshell/DMSShell.qml +++ b/quickshell/DMSShell.qml @@ -154,18 +154,18 @@ Item { property string _barLayoutStateJson: { const configs = SettingsData.barConfigs; - const mapped = configs.map(c => ({ + const mapped = configs.map((c, i) => ({ id: c.id, position: c.position, autoHide: c.autoHide, - visible: c.visible + visible: c.visible, + _origIndex: i })).sort((a, b) => { const aVertical = a.position === SettingsData.Position.Left || a.position === SettingsData.Position.Right; const bVertical = b.position === SettingsData.Position.Left || b.position === SettingsData.Position.Right; - if (aVertical !== bVertical) { + if (aVertical !== bVertical) return aVertical - bVertical; - } - return String(a.id).localeCompare(String(b.id)); + return a._origIndex - b._origIndex; }); return JSON.stringify(mapped); }