Skip to content

Commit 6c22aea

Browse files
Merge pull request #3251 from Jack251970/hide_window
Use api function to hide window
2 parents 9917de9 + 9284c55 commit 6c22aea

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ internal List<Result> InstallFromWeb(string url)
534534
return false;
535535
}
536536

537-
Application.Current.MainWindow.Hide();
537+
Context.API.HideMainWindow();
538538
_ = InstallOrUpdateAsync(plugin);
539539

540540
return ShouldHideWindow;
@@ -572,7 +572,7 @@ internal List<Result> InstallFromLocalPath(string localPath)
572572
return false;
573573
}
574574

575-
Application.Current.MainWindow.Hide();
575+
Context.API.HideMainWindow();
576576
_ = InstallOrUpdateAsync(plugin);
577577

578578
return ShouldHideWindow;
@@ -626,7 +626,7 @@ internal async ValueTask<List<Result>> RequestInstallOrUpdateAsync(string search
626626
return ShouldHideWindow;
627627
}
628628

629-
Application.Current.MainWindow.Hide();
629+
Context.API.HideMainWindow();
630630
_ = InstallOrUpdateAsync(x); // No need to wait
631631
return ShouldHideWindow;
632632
},
@@ -703,7 +703,7 @@ internal List<Result> RequestUninstall(string search)
703703
Context.API.GetTranslation("plugin_pluginsmanager_uninstall_title"),
704704
MessageBoxButton.YesNo) == MessageBoxResult.Yes)
705705
{
706-
Application.Current.MainWindow.Hide();
706+
Context.API.HideMainWindow();
707707
Uninstall(x.Metadata);
708708
if (Settings.AutoRestartAfterChanging)
709709
{

Plugins/Flow.Launcher.Plugin.Sys/Main.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ private List<Result> Commands()
333333
Action = c =>
334334
{
335335
// Hide the window first then show msg after done because sometimes the reload could take a while, so not to make user think it's frozen.
336-
Application.Current.MainWindow.Hide();
336+
context.API.HideMainWindow();
337337

338338
_ = context.API.ReloadAllPluginData().ContinueWith(_ =>
339339
context.API.ShowMsg(
@@ -352,7 +352,7 @@ private List<Result> Commands()
352352
IcoPath = "Images\\checkupdate.png",
353353
Action = c =>
354354
{
355-
Application.Current.MainWindow.Hide();
355+
context.API.HideMainWindow();
356356
context.API.CheckForNewUpdate();
357357
return true;
358358
}

0 commit comments

Comments
 (0)