From 7e3de02ecb020468532b577e16eba0db466b1df0 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Fri, 16 May 2025 19:23:49 +0800 Subject: [PATCH 1/2] initialize position before InitializeComponent --- Flow.Launcher/SettingWindow.xaml.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index ebbb3841482..ed4f4eb0831 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -30,9 +30,9 @@ public SettingWindow() _settings = Ioc.Default.GetRequiredService(); _viewModel = Ioc.Default.GetRequiredService(); DataContext = _viewModel; - InitializeComponent(); - + // Because WindowStartupLocation is Manual, so we need to initialize position before InitializeComponent UpdatePositionAndState(); + InitializeComponent(); } #endregion From 07ac325593718ec9fee3a57aadcc6fabd07a8c2e Mon Sep 17 00:00:00 2001 From: Jack Ye <1160210343@qq.com> Date: Fri, 16 May 2025 19:27:10 +0800 Subject: [PATCH 2/2] Improve code comments Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- Flow.Launcher/SettingWindow.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index ed4f4eb0831..c53a4ea80c4 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -30,7 +30,7 @@ public SettingWindow() _settings = Ioc.Default.GetRequiredService(); _viewModel = Ioc.Default.GetRequiredService(); DataContext = _viewModel; - // Because WindowStartupLocation is Manual, so we need to initialize position before InitializeComponent + // Since WindowStartupLocation is set to Manual, initialize the window position before calling InitializeComponent UpdatePositionAndState(); InitializeComponent(); }