Fcitx 5 on KDE Wayland: Fix the GTK_IM_MODULE and QT_IM_MODULE Warning

Notes

On Debian Sid with KDE Plasma running a Wayland session, Fcitx 5 showed this warning at startup:

GTK_IM_MODULE and QT_IM_MODULE are set while the Wayland input method frontend is working.
It is recommended to unset GTK_IM_MODULE and QT_IM_MODULE and use the Wayland frontend.

This means the desktop’s native Wayland input-method support is active, while the global GTK and Qt input-method variables are still forcing toolkit-specific modules. On KDE Plasma, those global overrides can cause issues such as a blinking candidate window. See the Fcitx 5 Wayland setup guide for the current compatibility details.

Use Plasma’s Wayland input-method integration

In KDE Plasma, open System Settings → Keyboard → Virtual Keyboard and select Fcitx 5. Then use im-config to choose Do not set any IM from im-config and use desktop default, which removes the global GTK_IM_MODULE and QT_IM_MODULE overrides while leaving the desktop’s own setup in control.

Log out of the desktop session and sign in again so the session and its applications inherit the updated environment. You can check the current values in a terminal with:

printenv GTK_IM_MODULE QT_IM_MODULE

Do not remove the im-config package just to silence the warning. Change its configuration instead; the package may be used to manage input-method settings on Debian-based systems.

Keep in mind that some older X11 applications or bundled Qt applications may need an input-method module of their own. Configure those applications individually if necessary rather than setting the variables globally for the whole Plasma Wayland session. Fcitx’s guide also explains when XMODIFIERS=@im=fcitx is still useful for XWayland applications.