diff --git a/OpenUtau/Views/MainWindow.axaml.cs b/OpenUtau/Views/MainWindow.axaml.cs index e895c1d5a..b1d1746ec 100644 --- a/OpenUtau/Views/MainWindow.axaml.cs +++ b/OpenUtau/Views/MainWindow.axaml.cs @@ -610,9 +610,20 @@ async void OnMenuInstallSinger(object sender, RoutedEventArgs args) { void OnMenuPackageManager(object sender, RoutedEventArgs args) { try { - var dialog = new PackageManagerDialog() { DataContext = new PackageManagerViewModel() }; - dialog.Show(); + var desktop = Application.Current?.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime; + if (desktop == null) { + return; + } + var dialog = desktop.Windows.FirstOrDefault(w => w is PackageManagerDialog) as PackageManagerDialog; + if (dialog == null) { + dialog = new PackageManagerDialog() { DataContext = new PackageManagerViewModel() }; + } if (dialog.Position.Y < 0) dialog.Position = dialog.Position.WithY(0); + if (dialog.WindowState == WindowState.Minimized) { + dialog.WindowState = WindowState.Normal; + } + dialog.Show(); + dialog.Activate(); } catch (Exception e) { DocManager.Inst.ExecuteCmd(new ErrorMessageNotification(e)); }