From 33c1c694de3c214306f72c16f7581cd93886dc6b Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Fri, 16 Jan 2026 01:55:20 +1100 Subject: internal: fix errors due to sync loaders --- modules/controlcenter/Panes.qml | 6 +++--- modules/controlcenter/Session.qml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'modules/controlcenter') diff --git a/modules/controlcenter/Panes.qml b/modules/controlcenter/Panes.qml index eba7de1..c239b91 100644 --- a/modules/controlcenter/Panes.qml +++ b/modules/controlcenter/Panes.qml @@ -108,7 +108,7 @@ ClippingRectangle { const diff = Math.abs(root.session.activeIndex - pane.paneIndex); const isActivePane = diff === 0; let shouldBeActive = false; - + if (!layout.initialOpeningComplete) { shouldBeActive = isActivePane; } else { @@ -120,7 +120,7 @@ ClippingRectangle { shouldBeActive = layout.animationComplete; } } - + loader.active = shouldBeActive; } @@ -132,7 +132,7 @@ ClippingRectangle { active: false Component.onCompleted: { - pane.updateActive(); + Qt.callLater(pane.updateActive); } onActiveChanged: { diff --git a/modules/controlcenter/Session.qml b/modules/controlcenter/Session.qml index 0408a1a..5c4bb05 100644 --- a/modules/controlcenter/Session.qml +++ b/modules/controlcenter/Session.qml @@ -16,6 +16,6 @@ QtObject { readonly property EthernetState ethernet: EthernetState {} readonly property LauncherState launcher: LauncherState {} - onActiveChanged: activeIndex = panes.indexOf(active) - onActiveIndexChanged: active = panes[activeIndex] + onActiveChanged: activeIndex = Math.max(0, panes.indexOf(active)) + onActiveIndexChanged: if (panes[activeIndex]) active = panes[activeIndex] } -- cgit v1.2.3-freya