From 07903628f1e6a8df81e3a636a63c11f74e429fe2 Mon Sep 17 00:00:00 2001 From: YsLtr Date: Wed, 25 Mar 2026 10:59:27 +0800 Subject: [PATCH] Avoid Linux minimize hangs and remove async warning --- v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs | 2 +- v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs b/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs index 6e7e183c..65dd938e 100644 --- a/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs @@ -156,7 +156,7 @@ public class ProfilesViewModel : MyReactiveObject { await MoveServer(EMove.Bottom); }, canEditRemove); - MoveToGroupCmd = ReactiveCommand.CreateFromTask(async sub => + MoveToGroupCmd = ReactiveCommand.Create(sub => { SelectedMoveToGroup = sub; }); diff --git a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs index 932973ca..b4759bb1 100644 --- a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs @@ -441,7 +441,7 @@ public partial class MainWindow : WindowBase private void BtnLinuxMinimize_Click(object? sender, RoutedEventArgs e) { - WindowState = WindowState.Minimized; + HideToTray(); } private void BtnLinuxMaximizeRestore_Click(object? sender, RoutedEventArgs e) @@ -510,7 +510,7 @@ public partial class MainWindow : WindowBase { if (Utils.IsLinux() && _config.UiItem.Hide2TrayWhenClose == false) { - WindowState = WindowState.Minimized; + HideToTray(); return; }