Avalonia icon indicating copy to clipboard operation
Avalonia copied to clipboard

[Linux] IME: Inconsistency between `X11DBusImeHelper.DetectInputMethod()` and `AvaloniaX11Platform.ShouldUseXim()`

Open AlanIWBFT opened this issue 2 months ago • 1 comments

Describe the bug

When running Avalonia under XWayland, the recommended way is to set XMODIFIERS for IME, for example, XMODIFIERS=@im=fcitx, and not setting any of GTK_IM_MODULE or QT_IM_MODULE. However, while AvaloniaX11Platform.ShouldUseXim() detects if XMODIFIERS is set, X11DBusImeHelper.DetectInputMethod() does not query its value, so that one of AVALONIA_IM_MODULE, GTK_IM_MODULE or QT_IM_MODULE still needs to be set for enabling IME, which may cause other issues.

To Reproduce

  1. Install sourcegit which is built upon Avalonia 11.3.8 (it has X11PlatformOptions.EnableIme set to true)
  2. Launch with XMODIFIERS=@im=fcitx set
  3. Focus any text box and try to activate IME
  4. Observe the IME does not work

Expected behavior

IME should work with just XMODIFIERS=@im=fcitx set

Avalonia version

11.3.8

OS

Linux

Additional context

No response

AlanIWBFT avatar Nov 01 '25 06:11 AlanIWBFT

Please, submit a PR that parses XMODIFIERS to detect fcitx separately.

kekekeks avatar Nov 29 '25 12:11 kekekeks