From c68a03e1936ca1a438a4e046980cf44648a8ef80 Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Thu, 15 Jan 2026 23:31:30 -0800 Subject: [PATCH] Delay window show until plugins are initialized - MainWindowVisibility starts as false (window hidden) - Window IsVisible bound to MainWindowVisibility - Set MainWindowVisibility = true in OnPluginsReady() after plugins load --- Flow.Launcher.Avalonia/MainWindow.axaml | 3 ++- Flow.Launcher.Avalonia/ViewModel/MainViewModel.cs | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher.Avalonia/MainWindow.axaml b/Flow.Launcher.Avalonia/MainWindow.axaml index 1d8a6ef32..017564871 100644 --- a/Flow.Launcher.Avalonia/MainWindow.axaml +++ b/Flow.Launcher.Avalonia/MainWindow.axaml @@ -24,7 +24,8 @@ Background="Transparent" ExtendClientAreaToDecorationsHint="True" ExtendClientAreaChromeHints="NoChrome" - SizeToContent="Height"> + SizeToContent="Height" + IsVisible="{Binding MainWindowVisibility, Mode=TwoWay}"> diff --git a/Flow.Launcher.Avalonia/ViewModel/MainViewModel.cs b/Flow.Launcher.Avalonia/ViewModel/MainViewModel.cs index 898c2a019..0ef2bd57f 100644 --- a/Flow.Launcher.Avalonia/ViewModel/MainViewModel.cs +++ b/Flow.Launcher.Avalonia/ViewModel/MainViewModel.cs @@ -37,7 +37,7 @@ public partial class MainViewModel : ObservableObject public event Action? ShowRequested; [ObservableProperty] - private bool _mainWindowVisibility = true; + private bool _mainWindowVisibility = false; [ObservableProperty] private string _queryText = string.Empty; @@ -96,7 +96,8 @@ public partial class MainViewModel : ObservableObject public void OnPluginsReady() { _pluginsReady = true; - Log.Info(ClassName, "Plugins ready"); + MainWindowVisibility = true; + Log.Info(ClassName, "Plugins ready - window shown"); if (!string.IsNullOrWhiteSpace(QueryText)) _ = QueryAsync(); }