From 2ea303f5571601d8521362ffd83d2b65c156cfc0 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Sun, 16 Mar 2025 16:51:07 +0800 Subject: [PATCH 1/2] Code cleanup --- Flow.Launcher/MainWindow.xaml | 4 ++-- Flow.Launcher/MainWindow.xaml.cs | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 0720501ca..93d79d767 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -20,7 +20,6 @@ Closing="OnClosing" Deactivated="OnDeactivated" Icon="Images/app.png" - SourceInitialized="OnSourceInitialized" Initialized="OnInitialized" Left="{Binding Settings.WindowLeft, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Loaded="OnLoaded" @@ -31,6 +30,7 @@ ResizeMode="CanResize" ShowInTaskbar="False" SizeToContent="Height" + SourceInitialized="OnSourceInitialized" Topmost="True" Visibility="{Binding MainWindowVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" WindowStartupLocation="Manual" @@ -377,7 +377,7 @@ Style="{DynamicResource SeparatorStyle}" /> - + diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 04e7867b1..0a73638b8 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -36,9 +36,7 @@ namespace Flow.Launcher public partial class MainWindow { #region Private Fields - - private readonly Storyboard _progressBarStoryboard = new Storyboard(); - private bool isProgressBarStoryboardPaused; + private readonly Settings _settings; private NotifyIcon _notifyIcon; private readonly ContextMenu contextMenu = new(); From ecc9f0daad7b80b3e7208c40821072179a89a4d6 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Sun, 16 Mar 2025 17:11:04 +0800 Subject: [PATCH 2/2] Fix acrylic backdrop flicker issue --- Flow.Launcher/MainWindow.xaml.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 0a73638b8..8a3137b86 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -181,19 +181,19 @@ namespace Flow.Launcher PreviewMouseMove += MainPreviewMouseMove; CheckFirstLaunch(); HideStartup(); - // show notify icon when flowlauncher is hidden + // Show notify icon when flowlauncher is hidden InitializeNotifyIcon(); InitializeColorScheme(); WindowsInteropHelper.DisableControlBox(this); InitProgressbarAnimation(); + // Move the window out of screen because setting backdrop will cause flicker with a rectangle + Left = Top = -10000; + await ThemeManager.Instance.RefreshFrameAsync(); // Initialize call twice to work around multi-display alignment issue- https://github.com/Flow-Launcher/Flow.Launcher/issues/2910 InitializePosition(); InitializePosition(); - // Refresh frame after position is intialized - await ThemeManager.Instance.RefreshFrameAsync(); PreviewReset(); - // since the default main window visibility is visible - // so we need set focus during startup + // Since the default main window visibility is visible, so we need set focus during startup QueryTextBox.Focus(); _viewModel.PropertyChanged += (o, e) =>