Browse Source

Set _ignoreWmChar when IME sends a ImeProcessed key to prevent input via WM_CHAR (#12942)

release/11.0.5-rc1
Benedikt Stebner 2 years ago
committed by Steven Kirk
parent
commit
1b856c8870
  1. 19
      src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs

19
src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs

@ -775,12 +775,19 @@ namespace Avalonia.Win32
if (message == WindowsMessage.WM_KEYDOWN)
{
// Handling a WM_KEYDOWN message should cause the subsequent WM_CHAR message to
// be ignored. This should be safe to do as WM_CHAR should only be produced in
// response to the call to TranslateMessage/DispatchMessage after a WM_KEYDOWN
// is handled.
_ignoreWmChar = e.Handled;
}
if(e is RawKeyEventArgs args && args.Key == Key.ImeProcessed)
{
_ignoreWmChar = true;
}
else
{
// Handling a WM_KEYDOWN message should cause the subsequent WM_CHAR message to
// be ignored. This should be safe to do as WM_CHAR should only be produced in
// response to the call to TranslateMessage/DispatchMessage after a WM_KEYDOWN
// is handled.
_ignoreWmChar = e.Handled;
}
}
if (s_intermediatePointsPooledList.Count > 0)
{

Loading…
Cancel
Save