From eaf0649d971999b8e146f6572004c786da6c737b Mon Sep 17 00:00:00 2001 From: DB p Date: Fri, 19 Nov 2021 09:17:48 +0900 Subject: [PATCH] Add Delay to Opacity when Main Window Deactive --- Flow.Launcher/Helper/SingletonWindowOpener.cs | 1 - Flow.Launcher/MainWindow.xaml.cs | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher/Helper/SingletonWindowOpener.cs b/Flow.Launcher/Helper/SingletonWindowOpener.cs index fdfaaa4fc..8efc9be99 100644 --- a/Flow.Launcher/Helper/SingletonWindowOpener.cs +++ b/Flow.Launcher/Helper/SingletonWindowOpener.cs @@ -10,7 +10,6 @@ namespace Flow.Launcher.Helper { var window = Application.Current.Windows.OfType().FirstOrDefault(x => x.GetType() == typeof(T)) ?? (T)Activator.CreateInstance(typeof(T), args); - Application.Current.MainWindow.Hide(); // Fix UI bug // Add `window.WindowState = WindowState.Normal` diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 75c6b2a2b..46db842df 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -315,9 +315,10 @@ namespace Flow.Launcher } - private void OnDeactivated(object sender, EventArgs e) + private async void OnDeactivated(object sender, EventArgs e) { _viewModel.Save(); + await Task.Delay(100); if (_settings.HideWhenDeactive) { _viewModel.Hide();