Skip to content

Conversation

@AlanIWBFT
Copy link

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)

* 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`)
if (Environment.GetEnvironmentVariable("AVALONIA_IM_MODULE") == "none"
|| Environment.GetEnvironmentVariable("GTK_IM_MODULE") == "none"
|| Environment.GetEnvironmentVariable("QT_IM_MODULE") == "none")
return true;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could not understand why this ever returns true - that's exactly the opposite of what AvaloniaX11Platform.EnableIme() is doing (it disables IME when AVALONIA_IM_MODULE is set to none)

@avaloniaui-bot
Copy link

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]

@cla-avalonia
Copy link
Collaborator

cla-avalonia commented Dec 2, 2025

  • All contributors have signed the CLA.

@MrJul MrJul added bug area-x11 backport-candidate-11.3.x Consider this PR for backporting to 11.3 branch labels Dec 5, 2025
@kekekeks
Copy link
Member

kekekeks commented Dec 5, 2025

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
Copy link
Member

kekekeks commented Dec 5, 2025

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

@AlanIWBFT
Copy link
Author

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

@avaloniaui-bot
Copy link

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]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-x11 backport-candidate-11.3.x Consider this PR for backporting to 11.3 branch bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

5 participants