From c0f8b6b84ca3920992b0f310d4f51538f52a83c0 Mon Sep 17 00:00:00 2001 From: ShiinaRinne <45081750+ShiinaRinne@users.noreply.github.com> Date: Thu, 30 Jan 2025 10:12:59 +0800 Subject: [PATCH] [macOS] amend: Child window visibility handling (#6598) https://github.com/2dust/v2rayN/pull/6596 When the main window is hidden, open child windows are mistakenly hidden as well. This prevents reopening child windows after the main window is shown again. --- v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs index 9f11041e..1c01db38 100644 --- a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs @@ -390,7 +390,6 @@ namespace v2rayN.Desktop.Views StorageUI(); await ViewModel?.MyAppExitAsync(false); - Close(); } #endregion Event @@ -414,6 +413,10 @@ namespace v2rayN.Desktop.Views { if (Utils.IsOSX() || _config.UiItem.Hide2TrayWhenClose) { + foreach (var ownedWindow in this.OwnedWindows) + { + ownedWindow.Close(); + } this.Hide(); } else @@ -492,4 +495,4 @@ namespace v2rayN.Desktop.Views #endregion UI } -} \ No newline at end of file +}