A big refactor in fcitx 5 is to enable it to support for multiple display server. This is not limited to X11 + wayland, but it means you can use fcitx with multiple X11 server. While such functionality may have limitation about your layout settings, but still it will work for most of cases.
qdbus-qt5 org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.OpenX11Connection :1
The support for multiple X connection exists in the code for long time but it didn’t expose to the world till the commit today.
With a simple dbus call above, you can open an new X11 connection to display server :1. The classicui window, XIM, or client that uses dbus protocol in it will be able to use the “right” window in the display server. Though, kimpanel will not be able to enjoy this.
To test this funtionality, try it with some simply client:
Xephyr :1 qdbus-qt5 org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.OpenX11Connection :1 DISPLAY=:1 openbox DISPLAy=:1 xterm
And you’ll find out that you can type in the xterm :P.