Skip to content

[BUG] Chinese IME: committing a composition with Shift duplicates the text in every TextBox (Avalonia Win32 double text input) #5819

Open

Agent suggestions

Public preview

Description

@chenxiang0010

Please confirm these before moving forward

  • I have searched for my issue and have not found a work-in-progress/duplicate/resolved issue.
  • I have tested that this issue has not been fixed in the latest (beta or stable) release.
  • I have checked the FAQ section for solutions.
  • This issue is about a bug (if it is not, please use the correct template).

UniGetUI Version

2026.3.4 (Build 107, Avalonia UI)

Windows version, edition, and architecture

Windows 11 Pro for Workstations 10.0.26300 x64

Describe your issue

Summary

On Windows, when a Chinese IME is active, typing a Latin word and committing the composition by tapping Shift (which switches the IME to English mode) inserts the word twice into the UniGetUI global search box. Committing the same word with Space works correctly.

Action Search box content
type claude (Chinese mode), press Space claude ✅
type claude (Chinese mode), press Shift claudeclaude ❌

Environment

  • UniGetUI 2026.3.4 (Build 107), Avalonia UI backend
  • Windows 11 Pro for Workstations 10.0.26300 x64
  • IME: Microsoft Bing Input Method / 中文输入法 1.0.0.17694 (C:\Program Files\BingKeyboard\BingIME.dll)
  • Microsoft Pinyin is also installed but not the active input

Scope

Not limited to the search box and not specific to UniGetUI: every Avalonia TextBox in the app is affected, and the same input sequence duplicates text in other Avalonia-based applications on this machine. WinUI/WPF/WinForms applications commit correctly with the same IME.

This is an Avalonia Win32 text-input bug, tracked upstream as:

Root cause (from the upstream analysis): WindowImpl.AppWndProc handles WM_IME_COMPOSITION with GCS_RESULTSTR by committing the string itself and then still passes the same message to DefWindowProc, which synthesizes one WM_CHAR per character. Avalonia swallows those fallback WM_CHARs only while _ignoreWmChar is true, and WM_KEYUP resets that flag. IMEs that legitimately commit on WM_KEYUP (a standalone Shift tap) hit the reset before the queued WM_CHARs are dequeued, so the text is inserted a second time.

Workaround / fix

Upstream suggests stripping the GCS_RESULT* flags from lParam before forwarding to DefWindowProc inside Avalonia.Win32, or suppressing the redundant WM_IME_CHAR via Win32Properties.AddWndProcHookCallback. Referenced in AvaloniaUI/Avalonia#20036 (comment by DearVa, 2026-11-17), with a verified patch.

Expected behavior

Pressing Shift to leave Chinese mode should commit the typed word exactly once, identical to pressing Space.

Actual behavior

The committed word is inserted twice. Screenshots below show the search box after typing claude and pressing Shift: claudeclaude.

Reported against the Avalonia UI build of UniGetUI; the legacy WPF build was not tested.

Steps to reproduce the issue

  1. Install a Chinese IME that commits the raw spelling when Shift toggles to English mode (reproduced with Microsoft Bing 中文输入法 1.0.0.17694; upstream also reproduces with Rime, QQ Pinyin, 微信输入法).
  2. Launch UniGetUI 2026.3.4 and open the Discover packages page.
  3. Click the global search box in the title bar (Ctrl+F).
  4. Switch the IME to Chinese mode.
  5. Type a Latin word, e.g. claude.
  6. Press Shift to commit and switch to English.

Result: the box contains claudeclaude.

Control case: repeat steps 5-6 but press Space instead of Shift — the box correctly contains claude.

The same sequence in Windows Notepad / any WinUI or WPF app produces claude once, so the input comes from the IME correctly.

UniGetUI Log

----- UniGetUI log (excerpt, C:\Users\****\AppData\Local\Temp\UniGetUI\session.log) -----
    Welcome to UniGetUI Version 2026.3.4
[2026-11-23 8:51:42 下午]
[2026-11-23 8:51:42 下午] Build 107
[2026-11-23 8:51:42 下午] UI Framework: Avalonia
[2026-11-23 8:51:42 下午] Data directory C:\Users\****\AppData\Local\UniGetUI
[2026-11-23 8:51:42 下午] OS: Microsoft Windows 10.0.26300
[2026-11-23 8:51:42 下午] Process arch: X64 (OS: X64)
[2026-11-23 8:51:42 下午] Runtime: .NET 10.0.15
[2026-11-23 8:51:42 下午] UI font: Microsoft YaHei UI, Segoe UI, Arial, Tahoma
[2026-11-23 8:51:42 下午] UI font fallbacks: Nirmala UI, Leelawadee UI, Microsoft YaHei UI, Microsoft YaHei, SimSun, SimSun-ExtB, Microsoft JhengHei UI, Microsoft JhengHei, MingLiU-ExtB, Yu Gothic UI, Yu Gothic, Malgun Gothic
[2026-11-23 8:51:42 下午] Loaded language locale: zh_CN
[2026-11-23 8:51:42 下午] Elevated: False
[2026-11-23 8:51:42 下午] Packaged (MSIX): False
[2026-11-23 8:51:42 下午] Args: (none)

[2026-11-23 9:03:51 下午] Checking updates via ProductInfo: https://devolutions.net/productinfo.json
[2026-11-23 9:03:52 下午] ProductInfo check: current=2026.3.4 (raw='2026.3.4'), available=2026.3.4 (raw='2026.3.4.0'), beta=False, upgradable=False
[2026-11-23 9:03:52 下午] Auto-updater source 'ProductInfo' returned version 2026.3.4.0 (upgradable=False)

----- Session in which the search box was exercised (query 'claude', 2026-11-21 22:07) -----
[2026-11-21 10:07:12 下午] Loaded 0 sources for manager Installer
[2026-11-21 10:07:12 下午] Found 0 available packages from Installer with the query claude
[2026-11-21 10:07:12 下午] Found 0 available packages from Cargo with the query claude
[2026-11-21 10:07:13 下午] Found 100 available packages from Bun with the query claude
[2026-11-21 10:07:14 下午] Found 25 available packages from Scoop with the query claude
[2026-11-21 10:07:40 下午] Found 30 available packages from Winget with the query claude

Note: the duplicated text is produced before the query reaches UniGetUI (the double WM_CHAR happens in the Avalonia Win32 message loop), so the log shows only a single search per keystroke; no UniGetUI-level error corresponds to this bug.

Package Managers Logs

----- Package manager logs (winget) -----
2026-11-23 20:41:30.788 [CORE] WinGet, version [1.12.470], activity [{82438880-FCD0-40EF-BD86-50787C0DFA6A}]
2026-11-23 20:41:30.788 [CORE] OS: Windows.Desktop v10.0.26300.9974
2026-11-23 20:41:30.788 [CORE] Command line Args: "C:\Program Files\UniGetUI\winget-cli_x64\winget.exe"  source update --disable-interactivity
2026-11-23 20:41:30.789 [CLI ] WinGet invoked with arguments: 'source' 'update' '--disable-interactivity'
2026-11-23 20:41:30.789 [CLI ] Found subcommand: source
2026-11-23 20:41:30.789 [CLI ] Found subcommand: update
2026-11-23 20:41:30.789 [CLI ] Leaf command to execute: root:source:update
2026-11-23 20:41:30.793 [CLI ] Executing command: update
2026-11-23 20:41:30.813 [REPO] Named source requested, found: msstore
2026-11-23 20:41:30.819 [REPO] Named source to be updated, found: msstore
2026-11-23 20:41:30.923 [REPO] Named source requested, found: winget
2026-11-23 20:41:32.649 [REPO] Source update success.
2026-11-23 20:41:33.022 [CLI ] Leaf command succeeded: root:source:update

Note: package managers are unrelated to this bug; the log is included to satisfy the template. No package operation was running when the duplicate text appeared.

Relevant information

Build details

  • UniGetUI version: 2026.3.4 (FileVersion 2026.3.4.0), Build 107
  • UI framework: Avalonia (Avalonia.Skia / Avalonia.Themes.Fluent 12.0.4 assemblies present in the install directory)
  • Runtime: .NET 10.0.15, Process arch X64
  • Installed at C:\Program Files\UniGetUI, not MSIX-packaged, not running elevated
  • UI language: zh_CN

IME details

  • Active input: Microsoft Bing 中文输入法 1.0.0.17694 ({E5A1B2C3-D4F5-6E7A-8B9C-0D1E2F3A4B5C}), signed by Microsoft Corporation
  • Microsoft Pinyin ({FA550B04-5AD7-411F-A5AC-CA038EC515D7}) is installed but disabled in the language list

Other places it reproduces

  • Any other Avalonia TextBox in the app (e.g. settings search, install-options text fields)
  • Other Avalonia applications on the same machine

Additional context

Nothing in the UniGetUI log corresponds to text input; the log excerpt above is from the same session only to satisfy the template. The bug is in the Avalonia Win32 IME path, not in UniGetUI's package logic.

Screenshots and videos

unigetui-ime-space-ok unigetui-ime-shift-duplicated

Activity

  1. added
    bug
    on Nov 23, 2026
  2. added
    possibly-upstream
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpossibly-upstream

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions