From c3bbf1fdda1fdc7aedab0ff078f12bf7151379de Mon Sep 17 00:00:00 2001 From: gramps Date: Sun, 1 Nov 2026 09:01:02 -0800 Subject: [PATCH] =?UTF-8?q?fix(zoom):=20ignore=20Ctrl=20auto-repeat=20?= =?UTF-8?q?=E2=80=94=20the=20box=20was=20closing=20itself=20as=20it=20was?= =?UTF-8?q?=20created?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Creation holds Ctrl (Ctrl+right-click), and Windows repeats a held modifier. The repeat tick landed after the box existed, so the dismiss handler saw an open box and closed it: appear, then vanish ~500ms later. Guarded with e.IsRepeat, which only ever skips the repeat events — a genuine second press still closes the box. --- MainWindow.xaml.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 140a408..54ae2d4 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -171,6 +171,11 @@ public partial class MainWindow : Window /// private void MainWindow_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e) { + // ⛔ e.IsRepeat matters: Windows auto-repeats a held modifier. Creation holds Ctrl (the + // chord is Ctrl+right-click), so without this guard the repeat tick ~500 ms later saw an + // open box and closed it — the box appeared and vanished as it was created. + if (e.IsRepeat) return; + if (e.Key is System.Windows.Input.Key.LeftCtrl or System.Windows.Input.Key.RightCtrl && _viewModel.IsZoomActive) {