From 94f247eefc17e9ddd130951dd45f483d9081b6dc Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Sat, 18 Oct 2025 09:26:15 -0400 Subject: [PATCH] SetupWizard: wait for proper detection of the OS before opening the wizard. --- Services/DistroService.qml | 7 +++++-- shell.qml | 30 +++++++++++++++++++++--------- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/Services/DistroService.qml b/Services/DistroService.qml index 6f5a8944..568bc2f0 100644 --- a/Services/DistroService.qml +++ b/Services/DistroService.qml @@ -12,6 +12,7 @@ Singleton { property string osPretty: "" property string osLogo: "" property bool isNixOS: false + property bool isReady: false // Internal helpers function buildCandidates(name) { @@ -79,8 +80,10 @@ Singleton { const osId = (val("ID") || "").toLowerCase() root.isNixOS = osId === "nixos" || (root.osPretty || "").toLowerCase().includes("nixos") const logoName = val("LOGO") - if (logoName) - resolveLogo(logoName) + if (logoName) { + resolveLogo(logoName) + } + root.isReady = true } catch (e) { Logger.w("DistroService", "failed to read os-release", e) } diff --git a/shell.qml b/shell.qml index 26022135..e3a41352 100644 --- a/shell.qml +++ b/shell.qml @@ -190,16 +190,28 @@ ShellRoot { function onSettingsLoaded() { // Only open the setup wizard for new users if (!Settings.data.setupCompleted) { - if (DistroService && DistroService.isNixOS) { - Settings.data.setupCompleted = true - return - } - if (Settings.data.settingsVersion >= Settings.settingsVersion) { - setupWizardLoader.active = true - } else { - Settings.data.setupCompleted = true - } + checkSetupWizard() } } } + + function checkSetupWizard() { + // Wait for distro service + if (!DistroService.isReady) { + Qt.callLater(checkSetupWizard) + return + } + + // No setup wizard on NixOS + if (DistroService.isNixOS) { + Settings.data.setupCompleted = true + return + } + + if (Settings.data.settingsVersion >= Settings.settingsVersion) { + setupWizardLoader.active = true + } else { + Settings.data.setupCompleted = true + } + } }