From 5d2e339e6dbec74d962e2357cb5078bbeb0412a0 Mon Sep 17 00:00:00 2001 From: Henglie <90338155+Henglie@users.noreply.github.com> Date: Sat, 7 Nov 2026 15:01:07 +0800 Subject: [PATCH] =?UTF-8?q?fix(desktop):=20=E5=88=A0=E9=99=A4=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4=E5=AF=B9=E8=AF=9D=E6=A1=86=E6=89=93=E5=BC=80=E6=97=B6?= =?UTF-8?q?=E8=81=9A=E7=84=A6=E7=A1=AE=E8=AE=A4=E6=8C=89=E9=92=AE=20(#1054?= =?UTF-8?q?2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 对话框弹出后键盘焦点仍停留在主列表,回车会触发列表的 SetDefaultServer 而不是确认按钮。在 MessageBoxDialog 打开时将焦点移到确认按钮,确保回车只确认对话框。 --- v2rayN/v2rayN.Desktop/Views/MessageBoxDialog.axaml.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/v2rayN/v2rayN.Desktop/Views/MessageBoxDialog.axaml.cs b/v2rayN/v2rayN.Desktop/Views/MessageBoxDialog.axaml.cs index 515568b8..4ee303cd 100644 --- a/v2rayN/v2rayN.Desktop/Views/MessageBoxDialog.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/MessageBoxDialog.axaml.cs @@ -25,9 +25,16 @@ public partial class MessageBoxDialog : Window btnYes.Click += BtnYes_Click; btnNo.Click += BtnNo_Click; + Opened += MessageBoxDialog_Opened; + CanMinimize = false; } + private void MessageBoxDialog_Opened(object? sender, EventArgs e) + { + btnYes.Focus(); + } + private void BtnYes_Click(object? sender, RoutedEventArgs e) { Close(ButtonResult.Yes);