diff --git a/src/Nonemm.App/Windows/EntryWindow.axaml.cs b/src/Nonemm.App/Windows/EntryWindow.axaml.cs index ae9e612..0a435af 100644 --- a/src/Nonemm.App/Windows/EntryWindow.axaml.cs +++ b/src/Nonemm.App/Windows/EntryWindow.axaml.cs @@ -374,7 +374,29 @@ public sealed partial class EntryWindow : Window } // typing answers whatever the status bar was reporting message = ""; - Refresh(); + RefreshAfterTyping(); + } + + private bool typingRefreshPosted; + + /// Refresh redraws this window and every open tool window, which is too + /// slow to run between two key presses. It runs once the key presses + /// waiting in the queue have been handled, so fast typing costs one + /// refresh instead of one per letter. + private void RefreshAfterTyping() + { + if (typingRefreshPosted) + { + return; + } + typingRefreshPosted = true; + Dispatcher.UIThread.Post( + () => + { + typingRefreshPosted = false; + Refresh(); + }, + DispatcherPriority.Background); } /// Set by Alt+W. Releasing Alt moves focus to the menu bar, so the