diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2026-01-16 01:55:20 +1100 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2026-01-16 01:59:20 +1100 |
| commit | 33c1c694de3c214306f72c16f7581cd93886dc6b (patch) | |
| tree | c7e72db99b3b3f0682343131c8bbf0c6268ee655 /modules/controlcenter | |
| parent | internal: no async loaders (diff) | |
| download | caelestia-shell-33c1c694de3c214306f72c16f7581cd93886dc6b.tar.gz caelestia-shell-33c1c694de3c214306f72c16f7581cd93886dc6b.tar.bz2 caelestia-shell-33c1c694de3c214306f72c16f7581cd93886dc6b.zip | |
internal: fix errors due to sync loaders
Diffstat (limited to 'modules/controlcenter')
| -rw-r--r-- | modules/controlcenter/Panes.qml | 6 | ||||
| -rw-r--r-- | modules/controlcenter/Session.qml | 4 |
2 files changed, 5 insertions, 5 deletions
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] } |