Avalonia icon indicating copy to clipboard operation
Avalonia copied to clipboard

[X11] Clean up IME inconsistencies

Open AlanIWBFT opened this issue 3 weeks ago • 6 comments

This fixes #19963

  • For XWayland apps setting XMODIFIERS=@im=fcitx alone should make IME work. *_IM_MODULE should not be required.
  • Fix where combinations like GTK_IM_MODULE=none XMODIFIERS=@im=fcitx can actually enable IME instead of forbid it - this is consistent with AvaloniaX11Platform.EnableIme()
  • XIM should always be used if none of IM_MODULE is set (instead of only when they are explicitly set to xim)

AlanIWBFT avatar Dec 02 '25 14:12 AlanIWBFT

You can test this PR using the following package version. 12.0.999-cibuild0060563-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

avaloniaui-bot avatar Dec 02 '25 14:12 avaloniaui-bot

  • [x] All contributors have signed the CLA.

cla-avalonia avatar Dec 02 '25 14:12 cla-avalonia

XIM should always be used if none of IM_MODULE is set (instead of only when they are explicitly set to xim)

Attempting to use XIM with ibus on plain X11 was freezing the app for me during the initial testing.

kekekeks avatar Dec 05 '25 11:12 kekekeks

I think we should properly parse @im= value and select the IME module accordingly.

kekekeks avatar Dec 05 '25 11:12 kekekeks

I think we should properly parse @im= value and select the IME module accordingly.

That was my initial implementation (parse @im in X11DBusImeHelper and connect through D-Bus). Yet I was aiming for a cleaner implementation so didn't go with it. Good to know the freezing issue, though XIM+ibus -> freezing should probably be considered as an ibus issue and we should not workaround that in ShouldUseXim(). Connecting through D-Bus should be enough to cover it. I will do it.

P.S.: XIM+fcitx under KDE Plasma X11 session works fine so definitely an ibus issue

AlanIWBFT avatar Dec 05 '25 11:12 AlanIWBFT

You can test this PR using the following package version. 12.0.999-cibuild0060637-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

avaloniaui-bot avatar Dec 05 '25 13:12 avaloniaui-bot

You can test this PR using the following package version. 12.0.999-cibuild0060815-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

avaloniaui-bot avatar Dec 16 '25 15:12 avaloniaui-bot