Browse Source
Fix issue that breaking IME discards input buffer (#14433)
Co-authored-by: Benedikt Stebner <Gillibald@users.noreply.github.com>
pull/12467/merge
Chris Sung
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
14 additions and
2 deletions
-
src/Windows/Avalonia.Win32/Input/Imm32InputMethod.cs
-
src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs
|
|
|
@ -334,11 +334,23 @@ namespace Avalonia.Win32.Input |
|
|
|
IsComposing = true; |
|
|
|
} |
|
|
|
|
|
|
|
public void HandleCompositionEnd() |
|
|
|
public void HandleCompositionEnd(uint timestamp) |
|
|
|
{ |
|
|
|
//Cleanup composition state.
|
|
|
|
IsComposing = false; |
|
|
|
|
|
|
|
if (_parent != null && !string.IsNullOrEmpty(Composition)) |
|
|
|
{ |
|
|
|
var e = new RawTextInputEventArgs(WindowsKeyboardDevice.Instance, timestamp, _parent.Owner, Composition); |
|
|
|
|
|
|
|
if (_parent.Input != null) |
|
|
|
{ |
|
|
|
_parent.Input(e); |
|
|
|
|
|
|
|
_parent._ignoreWmChar = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Composition = null; |
|
|
|
|
|
|
|
if (IsActive) |
|
|
|
|
|
|
|
@ -730,7 +730,7 @@ namespace Avalonia.Win32 |
|
|
|
} |
|
|
|
case WindowsMessage.WM_IME_ENDCOMPOSITION: |
|
|
|
{ |
|
|
|
Imm32InputMethod.Current.HandleCompositionEnd(); |
|
|
|
Imm32InputMethod.Current.HandleCompositionEnd(timestamp); |
|
|
|
|
|
|
|
return IntPtr.Zero; |
|
|
|
} |
|
|
|
|