fix(zoom): ignore Ctrl auto-repeat — the box was closing itself as it was created

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.
This commit is contained in:
2026-11-01 09:01:02 -08:00
parent 15734a5477
commit c3bbf1fdda
+5
View File
@@ -171,6 +171,11 @@ public partial class MainWindow : Window
/// </summary>
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)
{