From 35f880b563c21b14b4b3c8ac5fa95db3ed8c912a Mon Sep 17 00:00:00 2001 From: Damocles Date: Sun, 26 Apr 2026 15:17:27 +0200 Subject: [PATCH] tray: work around qt compiled binding bug on visible via indirection --- shell/modules/TrayModule.qml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/shell/modules/TrayModule.qml b/shell/modules/TrayModule.qml index 539ced5..492c82c 100644 --- a/shell/modules/TrayModule.qml +++ b/shell/modules/TrayModule.qml @@ -10,27 +10,28 @@ import "../services" as S M.BarModule { id: root spacing: S.Theme.moduleSpacing + 2 - visible: S.Modules.tray.enable && _trayRepeater.count > 0 cursorShape: Qt.ArrowCursor + // Workaround: Qt 6 compiled bindings break on `visible` when the expression + // references Repeater.count on a Row-derived component. The binding silently + // dies (imperative overwrite by the engine) and never re-evaluates. Routing + // through a custom property forces the interpreted binding path, which works. + property bool _shouldBeVisible: S.Modules.tray.enable && _trayRepeater.count > 0 + visible: _shouldBeVisible + required property var bar property var _activeMenu: null - // Shadow binding to test if QML dependency tracking works on a fresh property - property bool _shouldBeVisible: S.Modules.tray.enable && _trayRepeater.count > 0 + // --- debug logging (remove once tray is confirmed working) --- on_ShouldBeVisibleChanged: console.log("[TrayModule] _shouldBeVisible:", _shouldBeVisible, "actual visible:", visible) - Component.onCompleted: console.log("[TrayModule] created, enable:", S.Modules.tray.enable, "repeater count:", _trayRepeater.count) - onVisibleChanged: console.log("[TrayModule] visible:", visible, "enable:", S.Modules.tray.enable, "count:", _trayRepeater.count) - Connections { target: _trayRepeater function onCountChanged() { console.log("[TrayModule] repeater count:", _trayRepeater.count, "visible:", root.visible, "shouldBe:", S.Modules.tray.enable && _trayRepeater.count > 0); } } - Connections { target: SystemTray.items function onValuesChanged() {