https://fcitx-im.org/api.php?action=feedcontributions&user=Weng+Xuetian&feedformat=atomFcitx - User contributions [en]2024-03-19T13:05:55ZUser contributionsMediaWiki 1.35.2https://fcitx-im.org/index.php?title=Upgrade_from_Fcitx_4&diff=46001Upgrade from Fcitx 42024-01-10T18:54:32Z<p>Weng Xuetian: </p>
<hr />
<div>= Where is my data? =<br />
Almost all Fcitx 4 data are stored under <code>~/.config/fcitx</code>.<br />
<br />
For Fcitx 5, the paths follow more closely to XDG standard, which are <code>~/.local/share/fcitx5</code> and <code>~/.config/fcitx5</code>.<br />
<br />
Specifically, Rime data was located at <code>~/.config/fcitx/rime</code> with Fcitx 4, while it is <code>~/.local/share/fcitx5/rime</code> in Fcitx 5.<br />
<br />
= What package do I need to install? =<br />
The distribution may have there own way to split package, I'll only talk about it on the source package how they mapped.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Fcitx 4 !! Fcitx 5<br />
|-<br />
| fcitx || fcitx5, fcitx5-gtk (Gtk IM Module), fcitx5-qt (Qt IM Module), fcitx5-chinese-addons (Pinyin & Table)<br />
|-<br />
| fcitx-qt5 || fcitx5-qt<br />
|-<br />
| fcitx-configtool || fcitx5-configtool<br />
|-<br />
| kcm-fcitx || fcitx5-configtool<br />
|-<br />
| fcitx-anthy || fcitx5-anthy<br />
|-<br />
| fcitx-chewing || fcitx5-chewing<br />
|-<br />
| fcitx-cloudpinyin || fcitx5-chinese-addons<br />
|-<br />
| fcitx-fbterm || fcitx5-fbterm<br />
|-<br />
| fcitx-hangul || fcitx5-hangul<br />
|-<br />
| fcitx-kkc || fcitx5-kkc<br />
|-<br />
| fcitx-libpinyin || Please use fcitx5-chinese-addons Pinyin instead.<br />
|-<br />
| fcitx-m17n || fcitx5-m17n<br />
|-<br />
| fcitx-rime || fcitx5-rime<br />
|-<br />
| fcitx-sayura || fcitx5-sayura<br />
|-<br />
| fcitx-skk || fcitx5-skk<br />
|-<br />
| fcitx-sunpinyin || Please use fcitx5-chinese-addons Pinyin instead.<br />
|-<br />
| fcitx-table-extra || fcitx5-table-extra<br />
|-<br />
| fcitx-table-other || fcitx5-table-other<br />
|-<br />
| fcitx-unikey || fcitx5-unikey<br />
|-<br />
| fcitx-zhuyin || fcitx5-zhuyin<br />
|}<br />
<br />
= Can I keep my old data? =<br />
You'll need to reconfigure the input method list, migrating configuration file is not supported.<br />
<br />
Certain engine does not store the data in fcitx's path, so they can be reused directly, e.g. Mozc, Anthy.<br />
<br />
There are certain data can be migrated. fcitx5-migrator in fcitx5-configtool will help you do that. The supported Engine includes Pinyin, Rime, Table, SKK, KKC.</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Upgrade_from_Fcitx_4&diff=46000Upgrade from Fcitx 42024-01-10T18:53:00Z<p>Weng Xuetian: </p>
<hr />
<div>= Where is my data? =<br />
Almost all Fcitx 4 data are stored under ~/.config/fcitx.<br />
<br />
For Fcitx 5, the paths follow more closely to XDG standard, which are ~/.local/share/fcitx5 and ~/.config/fcitx5.<br />
<br />
Specifically, Rime data was located at ~/.config/fcitx/rime with Fcitx 4, while it is ~/.local/share/fcitx5/rime in Fcitx 5.<br />
<br />
= What package do I need to install? =<br />
The distribution may have there own way to split package, I'll only talk about it on the source package how they mapped.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Fcitx 4 !! Fcitx 5<br />
|-<br />
| fcitx || fcitx5, fcitx5-gtk (Gtk IM Module), fcitx5-qt (Qt IM Module), fcitx5-chinese-addons (Pinyin & Table)<br />
|-<br />
| fcitx-qt5 || fcitx5-qt<br />
|-<br />
| fcitx-configtool || fcitx5-configtool<br />
|-<br />
| kcm-fcitx || fcitx5-configtool<br />
|-<br />
| fcitx-anthy || fcitx5-anthy<br />
|-<br />
| fcitx-chewing || fcitx5-chewing<br />
|-<br />
| fcitx-cloudpinyin || fcitx5-chinese-addons<br />
|-<br />
| fcitx-fbterm || fcitx5-fbterm<br />
|-<br />
| fcitx-hangul || fcitx5-hangul<br />
|-<br />
| fcitx-kkc || fcitx5-kkc<br />
|-<br />
| fcitx-libpinyin || Please use fcitx5-chinese-addons Pinyin instead.<br />
|-<br />
| fcitx-m17n || fcitx5-m17n<br />
|-<br />
| fcitx-rime || fcitx5-rime<br />
|-<br />
| fcitx-sayura || fcitx5-sayura<br />
|-<br />
| fcitx-skk || fcitx5-skk<br />
|-<br />
| fcitx-sunpinyin || Please use fcitx5-chinese-addons Pinyin instead.<br />
|-<br />
| fcitx-table-extra || fcitx5-table-extra<br />
|-<br />
| fcitx-table-other || fcitx5-table-other<br />
|-<br />
| fcitx-unikey || fcitx5-unikey<br />
|-<br />
| fcitx-zhuyin || fcitx5-zhuyin<br />
|}<br />
<br />
= Can I keep my old data? =<br />
You'll need to reconfigure the input method list, migrating configuration file is not supported.<br />
<br />
Certain engine does not store the data in fcitx's path, so they can be reused directly, e.g. Mozc, Anthy.<br />
<br />
There are certain data can be migrated. fcitx5-migrator in fcitx5-configtool will help you do that. The supported Engine includes Pinyin, Rime, Table, SKK, KKC.</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Fcitx_5/zh-cn&diff=45999Fcitx 5/zh-cn2024-01-10T18:51:45Z<p>Weng Xuetian: </p>
<hr />
<div><languages/><br />
<br />
小企鹅输入法(Fcitx 读作[ˈfaɪtɪks])是一个支持扩展的输入法框架。目前,它支持Linux操作系统,以及如freebsd这样的Unix操作系统。Fcitx 通过使用各种各样的输入法引擎来支持全世界大量不同种类的语言。<br />
<br />
Fcitx本身的核心实现非常简单,它通过使用插件来提供强大的功能。fcitx可以非常容易的进行定制以满足不同的个性化需求。<br />
<br />
[[Special:myLanguage/Fcitx|导航至旧版的 Fcitx 4 Wiki页面?]]<br />
<br />
==== 用户 ====<br />
<br />
* [[Special:myLanguage/Install Fcitx 5|如何安装 Fcitx 5]]<br />
* [[Special:myLanguage/Setup Fcitx 5|设置 Fcitx 5]]<br />
* 安装 [[Special:myLanguage/Input method engines|输入法引擎]]<br />
* [[Special:myLanguage/Theme Customization|定制您的输入法主题]]<br />
* [[Special:myLanguage/FAQ|常见问题]]<br />
* [[Special:myLanguage/Using Fcitx 5 on Wayland|在 Wayland 上使用 Fcitx 5]]<br />
* [[Special:myLanguage/Upgrade from Fcitx 4|从 Fcitx 4 升级]]<br />
<br />
==== 开发者 ====<br />
<br />
* [[Special:myLanguage/Compiling fcitx5|如何编译 fcitx5]]<br />
* [[Special:myLanguage/Basic concept|基本概念]]<br />
* [[Special:myLanguage/Develop an simple input method|如何开发一个简单的输入法]]<br />
* [[Special:myLanguage/Q&A for developer|开发者常见问题与解答]]<br />
* [[Special:myLanguage/Debug fcitx5|调试 fcitx5]]<br />
<br />
==== 新闻 ====<br />
<br />
<rss max=5>https://politepol.com/fd/hhM5BOjZLblk</rss><br />
<br />
== 如何帮助 Fcitx ==<br />
* 给你的朋友推荐Fcitx输入法<br />
* [[Special:myLanguage/Report Bug|报告漏洞]]<br />
* [[Special:myLanguage/Contribute to this Wiki|为Wiki做贡献]] ('''请在申请你的帐号之前仔细阅读此页面''')<br />
* [[Special:myLanguage/Donate|捐助]]<br />
<br />
== 关于 ==<br />
* [[Special:myLanguage/History|Fcitx的历史]]</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Translations:Fcitx_5/5/zh-cn&diff=45998Translations:Fcitx 5/5/zh-cn2024-01-10T18:51:45Z<p>Weng Xuetian: </p>
<hr />
<div>* [[Special:myLanguage/Install Fcitx 5|如何安装 Fcitx 5]]<br />
* [[Special:myLanguage/Setup Fcitx 5|设置 Fcitx 5]]<br />
* 安装 [[Special:myLanguage/Input method engines|输入法引擎]]<br />
* [[Special:myLanguage/Theme Customization|定制您的输入法主题]]<br />
* [[Special:myLanguage/FAQ|常见问题]]<br />
* [[Special:myLanguage/Using Fcitx 5 on Wayland|在 Wayland 上使用 Fcitx 5]]<br />
* [[Special:myLanguage/Upgrade from Fcitx 4|从 Fcitx 4 升级]]</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Upgrade_from_Fcitx_4&diff=45994Upgrade from Fcitx 42024-01-10T18:35:43Z<p>Weng Xuetian: Created page with "= Where is my data? = Almost all Fcitx 4 data are stored under ~/.config/fcitx. For Fcitx 5, the paths follow more closely to XDG standard, which are ~/.local/share/fcitx5 an..."</p>
<hr />
<div>= Where is my data? =<br />
Almost all Fcitx 4 data are stored under ~/.config/fcitx.<br />
<br />
For Fcitx 5, the paths follow more closely to XDG standard, which are ~/.local/share/fcitx5 and ~/.config/fcitx5.<br />
<br />
= What package do I need to install? =<br />
The distribution may have there own way to split package, I'll only talk about it on the source package how they mapped.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Fcitx 4 !! Fcitx 5<br />
|-<br />
| fcitx || fcitx5, fcitx5-gtk (Gtk IM Module), fcitx5-qt (Qt IM Module), fcitx5-chinese-addons (Pinyin & Table)<br />
|-<br />
| fcitx-qt5 || fcitx5-qt<br />
|-<br />
| fcitx-configtool || fcitx5-configtool<br />
|-<br />
| kcm-fcitx || fcitx5-configtool<br />
|-<br />
| fcitx-anthy || fcitx5-anthy<br />
|-<br />
| fcitx-chewing || fcitx5-chewing<br />
|-<br />
| fcitx-cloudpinyin || fcitx5-chinese-addons<br />
|-<br />
| fcitx-fbterm || fcitx5-fbterm<br />
|-<br />
| fcitx-hangul || fcitx5-hangul<br />
|-<br />
| fcitx-kkc || fcitx5-kkc<br />
|-<br />
| fcitx-libpinyin || Please use fcitx5-chinese-addons Pinyin instead.<br />
|-<br />
| fcitx-m17n || fcitx5-m17n<br />
|-<br />
| fcitx-rime || fcitx5-rime<br />
|-<br />
| fcitx-sayura || fcitx5-sayura<br />
|-<br />
| fcitx-skk || fcitx5-skk<br />
|-<br />
| fcitx-sunpinyin || Please use fcitx5-chinese-addons Pinyin instead.<br />
|-<br />
| fcitx-table-extra || fcitx5-table-extra<br />
|-<br />
| fcitx-table-other || fcitx5-table-other<br />
|-<br />
| fcitx-unikey || fcitx5-unikey<br />
|-<br />
| fcitx-zhuyin || fcitx5-zhuyin<br />
|}<br />
<br />
= Can I keep my old data? =<br />
You'll need to reconfigure the input method list, migrating configuration file is not supported.<br />
<br />
Certain engine does not store the data in fcitx's path, so they can be reused directly, e.g. Mozc, Anthy.<br />
<br />
There are certain data can be migrated. fcitx5-migrator in fcitx5-configtool will help you do that. The supported Engine includes Pinyin, Rime, Table, SKK, KKC.</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Fcitx_5&diff=45993Fcitx 52024-01-10T18:19:57Z<p>Weng Xuetian: </p>
<hr />
<div><languages/><br />
<translate><br />
<br />
<!--T:1--><br />
Fcitx [ˈfaɪtɪks] is an input method framework with extension support. Currently it supports Linux and Unix systems like freebsd. Fcitx supports typing with many languages all over the world with a large number of engines.<br />
<br />
<!--T:2--><br />
Fcitx has a slim core while provides powerful features with addons. It is easy to customize fcitx to satisfy your own needs.<br />
<br />
<!--T:3--><br />
[[Special:myLanguage/Fcitx|Looking for Old Wiki Page for Fcitx 4?]]<br />
<br />
==== For Users ==== <!--T:4--><br />
<br />
<!--T:5--><br />
* [[Special:myLanguage/Install Fcitx 5|Install Fcitx 5]]<br />
* [[Special:myLanguage/Setup Fcitx 5|Setup Fcitx 5]]<br />
* Install [[Special:myLanguage/Input method engines|Input method engines]]<br />
* [[Special:myLanguage/Theme Customization|Theme Customization]]<br />
* [[Special:myLanguage/FAQ|FAQ]]<br />
* [[Special:myLanguage/Using Fcitx 5 on Wayland|Using Fcitx 5 on Wayland]]<br />
* [[Special:myLanguage/Upgrade from Fcitx 4|Upgrade from Fcitx 4]]<br />
<br />
==== For Developers ==== <!--T:6--><br />
<br />
<!--T:7--><br />
* [[Special:myLanguage/Compiling fcitx5|Compiling fcitx5]]<br />
* [[Special:myLanguage/Basic concept|Basic concept]]<br />
* [[Special:myLanguage/Develop an simple input method|Develop an simple input method]]<br />
* [[Special:myLanguage/Q&A for developer|Q&A for developer]]<br />
* [[Special:myLanguage/Debug fcitx5|Debug fcitx5]]<br />
<br />
==== News ==== <!--T:8--><br />
<br />
<!--T:9--><br />
<rss max=5>https://politepol.com/fd/hhM5BOjZLblk</rss><br />
<br />
== Help Fcitx == <!--T:10--><br />
* Recommend Fcitx to your friend<br />
* [[Special:myLanguage/Report Bug|Report Bug]]<br />
* [[Special:myLanguage/Contribute to this Wiki|Contribute to this Wiki]] ('''Please read this before you request account''')<br />
* [[Special:myLanguage/Donate|Donate]]<br />
<br />
== About Fcitx == <!--T:11--><br />
* [[Special:myLanguage/History|History]]<br />
<br />
</translate></div>Weng Xuetianhttps://fcitx-im.org/index.php?title=FAQ&diff=45992FAQ2024-01-06T16:13:20Z<p>Weng Xuetian: </p>
<hr />
<div><languages/><br />
<translate><br />
<br />
<!--T:1--><br />
When you want to complain about input method cannot work correctly, please read this first.<br />
<br />
<!--T:72--><br />
Since 4.2.7, fcitx provides a command called fcitx-diagnose, it will try to detect some common problem and give some advice.<br />
<br />
<!--T:2--><br />
[[Special:MyLanguage/Hall of Shame for Linux IME Support|Hall of Shame for Linux IME Support]]<br />
<br />
== When use Ctrl + Space, Fcitx cannot be triggered on == <!--T:3--><br />
<br />
<!--T:37--><br />
Check the application you want to type into.<br />
<br />
=== Wayland === <!--T:84--> <br />
<br />
<!--T:89--><br />
See [[Special:MyLanguage/Using Fcitx 5 on Wayland|Using Fcitx 5 on Wayland]].<br />
<br />
=== Only one specific app has problem? === <!--T:61--><br />
* The most possible reason for this is Ctrl+Space occupied by some hotkey, please change to another trigger key and try again. This usually happens in some editor, since many ide use Ctrl+Space as default key binding for Completion.<br />
<br />
=== All Gtk Apps have problem? === <!--T:62--><br />
* Please open a traditional Gtk App (traditional Gtk App means, it cannot be Firefox, Libreoffice, which only use Gtk as a UI style). Gedit is a good choice. Right click at the input box, there will be a menu named "Input Method", please make sure there is "Fcitx" in it and being choosed.<br />
<br />
<!--T:63--><br />
* If there is "Fcitx", but it still not works. Please try to restart Fcitx, if it will works at this time, please check your DBus settings, or make Fcitx start later. You can read [[Special:MyLanguage/Configure (Other)|Configure (Other)]] if you're using a custom startup script.<br />
<br />
<!--T:64--><br />
* If there is Fcitx but not being choosed by default, and please select it and you can immediately try again in this app. If not works, please read the entry above. For permanent fix (To use Fcitx by default), please read Configure part in [[Special:MyLanguage/Install And Configure|Install And Configure]].<br />
<br />
<!--T:65--><br />
* If there is no Fcitx, you should check your install first. Usually, the package name contains fcitx and gtk. If you [[Special:MyLanguage/Compile from source|compile fcitx from source]], please make sure you have enable GTK{2,3}_IM_MODULE option. If you're sure about this, please read [[Special:MyLanguage/Input method related environment variables|Input method related environment variables]] for how to update some cached file for gtk.<br />
<br />
<!--T:38--><br />
* If you are using Ubuntu and upgrade to 12.04 recently, or something werid happens to your system (Due to packager careless, or buggy package manager which can not do upgrade in correct order, for example, [https://bugs.archlinux.org/task/32764 pacman]), you might notice that gtk.immodules related files doesn't generate correctly during upgrade. Try uninstall {{package ubuntu|fcitx-frontend-gtk2}}, {{package ubuntu|fcitx-frontend-gtk3}} or coressponding package on your system and re-install them to trigger the file generate. Then recheck the input method menu to see whether it have "Fcitx" in the menu or not.<br />
<br />
=== All Qt Apps have problem? === <!--T:66--><br />
* Run qtconfig (might have different name on your distribution, it might be qtconfig-qt4), and go to the third tab, make sure fcitx is in the "Default Input Method" combo-box. If not, please check your install.<br />
* Above solution can also applies if you want use XIM, but still we highly recommend you to use im module. See Also [[Special:MyLanguage/Input method related environment variables|Input method related environment variables]].<br />
<br />
==== Telegram desktop ==== <!--T:77--><br />
Some distribution enables Qt6 for telegram desktop. Just make sure you have the Qt6 im module (For fcitx4, it's fcitx-qt6 on archlinux).<br />
<br />
=== Chromium or any other chromium based browser (E.g. Microsoft Edge) === <!--T:85--><br />
For Chromium running under X11, if you are using startx to start your graphical user interface, you may hit [https://gitlab.freedesktop.org/xorg/app/xinit/-/issues/9 an issue] in startx that unset the DBUS_SESSION_BUS_ADDRESS, which prevent chromium based browser from using dbus correctly. To mitigate this, you may:<br />
<br />
<!--T:86--><br />
1. either export DBUS_SESSION_BUS_ADDRESS by yourself in your ~/.xinitrc (or simply change to use ~/.xsession if you are using debian based system).<br />
<br />
<!--T:87--><br />
2. or use a display manager like sddm, gdm, lightdm instead of startx.<br />
<br />
<!--T:88--><br />
For Chromium that runs natively under wayland, the only native wayland input method protocol it supports is text-input-v1, which is only supported by weston. Alternatively, it can also use Gtk4's im module, you can use following flag (---enable-features=UseOzonePlatform --ozone-platform=wayland --gtk-version=4) to make it use Gtk im module, but it doesn't fully work in terms of popup window position unless you are using kimpanel + GNOME.<br />
<br />
=== Is it Java, Xterm, wine, or some other non-Gtk/Qt Application? === <!--T:39--><br />
There are also some very rare case, that you're using a embedded linux or mini-linux distro, in which you must use XIM, the X server might missing some locale file. The file is usually needed to be under /usr/share/X11/locale/.<br />
<br />
<!--T:40--><br />
And When you must use XIM, please make sure, your locale '''must NOT''' be C or POSIX and need to be a valid locale (no matter which language), and need to be generated if you are using glibc (locale-gen). When you are using im module, there is no such limitation.<br />
<br />
=== Is it a Qt application that bundles its own Qt library? === <!--T:74--><br />
Bundled Qt library usually uses theirs own plugin directory, which is different from system's Qt. And commonly, they are also using Qt different on system Qt, which will also make it incompatible if you simply copy the system fcitx-qt files. But anyway, you can start to check whether it loads your copied files with following environment variable. Depending on how the XIM application is written, it may need to find specific font to make it work. On Archlinux xorg-mkfontscale is required to generate correct font dir files. After install it, you'll need to restart X Server to make it work.<br />
<br />
<!--T:75--><br />
QT_DEBUG_PLUGINS=1 QT_LOGGING_RULES="*.debug=true"<br />
<br />
<!--T:76--><br />
And try to resolve all incompatible errors. Usually, ubuntu's fcitx-frontend-qt5 and libfcitxqt5-1 are good source for fcitx-qt5 build against specific qt version. For example, DraftSight 2017S0 [https://groups.google.com/forum/#!topic/fcitx/9e4TI39_4sk] may work with xenial's fcitx-qt5.<br />
<br />
=== Emacs === <!--T:67--><br />
Try<br />
<br />
<!--T:68--><br />
LC_CTYPE=zh_CN.UTF-8 emacs<br />
<br />
<!--T:69--><br />
Don't forget to check your locale -a contains that. See also [[Special:MyLanguage/Input method related environment variables|Input method related environment variables]].<br />
<br />
<!--T:70--><br />
Emacs will use `-*-*-*-r-normal--<some font size>-*-*-*-*-*-*-*' as basefont(in src/xfns.c), if you do not have one matched, the code for input method won't run. Install some font package may help (For required fonts xorg-fonts-misc might be the right package but you can also try other xorg-fonts-* package.). <br />
<br />
=== Non Gtk/Qt Wayland Application (Alacritty, kitty, etc) === <!--T:78--><br />
It is possible that the application you use does not support input method at all, because they need to have relevant code to implement it. Even if they do, it is highly possible that compositor does not have the support for input method. Only GNOME Shell and KWin has full text-input-v3 support. As of 2022/05/07, sway still does not have full zwp_input_method_v2 support to support input surface. For KWin, you will need Plasma 5.24+ and Fcitx 5.0.14+ and make KWin to start Fcitx 5. You will need to go to Virtual Keyboard KCM and select Fcitx 5 in the KCM.<br />
<br />
== Candidate window is blinking under wayland with Fcitx 5 == <!--T:79--><br />
This is mainly due to the whole poor state of wayland input method. The existing wayland input method protocol is not widely supported by compositor. Even though fcitx 5 support those protocols, the poor support in application and compositor make them not usable. Not to mention certain design flaw within the protocol.<br />
<br />
<!--T:80--><br />
In order to make input method some what usable with '''CURRENTLY''' available and widely adopted techniques, Fcitx 5 implements a mechanism called "Client Side Input Panel", which basically asks client application to render the input window. This is done through dbus and IM Module for Gtk/Qt. The implementation requires using a underlying wayland protocol xdg_popup to show the window. Unfortunately, only new version of xdg_popup protocol supports '''moving''' a visible popup window, and this part is '''NOT''' implemented in Gtk3 and Qt5. What makes it even worse is that Gtk3 and Qt5 both comes to their end of life, which means it is not possible to get this new protocol support in Gtk3/Qt5. The issue is that input method requires to display a window that resizes and moves extremely frequently. To mitigate this issue, Fcitx 5 IM Module implement a hack that when we need to move the window, it will hide the window first and then show the window. Unfortunately, this would cause certain-level of blinking. It might looks bad in certain hardware and compositor combination.<br />
<br />
<!--T:81--><br />
Here is some possible workaround for this.<br />
<br />
<!--T:82--><br />
1. Use kimpanel under GNOME shell, which will make the candidate window to be rendered with a totally different mechanism, which won't cause any blinking. <br />
<br />
<!--T:83--><br />
2. Disable Fade-in and Fade-Out effect under KWin. KWin seems to tolerate such blink much better than certain compositor.<br />
<br />
== Problem in Firefox and Google Docs == <!--T:4--><br />
<br />
<!--T:41--><br />
You might want to toggle preedit off temporarily, which is Ctrl+Alt+P.<br />
<br />
== Cannot use Fcitx in flash == <!--T:5--><br />
<br />
<!--T:42--><br />
Please read [[Special:MyLanguage/Hall of Shame for Linux IME Support|Hall of Shame for Linux IME Support]], and use im module.<br />
<br />
== Cannot type English after updating to fcitx newer than 4.2.4 == <!--T:6--><br />
<br />
<!--T:43--><br />
Make sure you have add "[[Special:myLanguage/Keyboard|Keyboard]]" to the input method list. You can use [[Special:myLanguage/Integrate with Desktop#Configuration tool|Configuration tool]].<br />
<br />
<!--T:44--><br />
And you may want to move "Keyboard" to the first one.<br />
<br />
== Unexpected keyboard layout change == <!--T:7--><br />
<br />
<!--T:45--><br />
Use [[Special:myLanguage/Integrate with Desktop#Configuration tool|Configuration tool]], to bind specific keyboard layout to the specific input method.<br />
<br />
== xmodmap settings being overwritten == <!--T:8--><br />
<br />
<!--T:46--><br />
Fcitx now control keyboard layout and when switch layout, xmodmap setting will be overwritten. So fcitx-xkb provides an option to specify the xmodmap script and let fcitx loads it for you whenever keyboard layout changes. Or disable fcitx-xkb addon is also a solution for you, or if your requirement is simply, for example, switching Caps Lock and Esc, which is provided by xkb option, you can just set it with your desktop keyboard configuration tool (Gnome and KDE all support such configuration).<br />
<br />
<!--T:47--><br />
For more detailed explanation, xmodmap is a very low level tool, that doesn't aware keyboard layout. For X11, keyboard layout is built on a set of profile, when such profile is loaded, anything you changed with xmodmap will be overwritten, this isn't specific to fcitx, but all tool that support keyboard layout configuration. Xkb option is a set of profile that can do some pre-defined change over keyboard layout, including many thing that people usually do with xmodmap, for example, defining where dead key is, switching Caps Lock and Esc, and so on. Unless you have special requirements, xkb layout and xkb option is recommended.<br />
<br />
<!--T:71--><br />
Since 4.2.7, Fcitx will try to load ~/.Xmodmap if it exists.<br />
<br />
== Configure user interface, font, vertical list == <!--T:9--><br />
<br />
<!--T:48--><br />
Use [[Special:myLanguage/Integrate with Desktop#Configuration tool|Configuration tool]], Addon Configuration -> Classic UI.<br />
<br />
<!--T:49--><br />
If you are using [[Special:myLanguage/Configtool|fcitx-configtool]] newer than 0.4.5 or [[Special:myLanguage/Kcm|kcm-fcitx]] newer 0.4.1, you can directly configure those from the first level tab.<br />
<br />
== Possible issue for GNOME 3.6 == <!--T:10--><br />
<br />
<!--T:50--><br />
[[Note for GNOME Later than 3.6]]<br />
<br />
== [[Special:MyLanguage/ClassicUI|Classic UI]] is not transparent == <!--T:11--><br />
<br />
* This problem might NOT exist any more since 4.2.6 with a different approach for detect composite manager.<br />
* Restart Fcitx first, if it's ok then, it might be a bug in your Window manager. Gnome-Shell, xcompmgr is known to have this bug. You can try to set the delay start to walkaround this problem.<br />
* If restart Fcitx doesn't solve this problem, you should check whether your window manager supports composite or it's enabled or not.<br />
=== Kwin === <!--T:51--><br />
<br />
Enable desktop effects.<br />
=== Metacity before GNOME3 === <!--T:52--><br />
<br />
gconftool-2 -s --type bool /apps/metacity/general/compositing_manager true<br />
=== Xfce === <!--T:53--><br />
<br />
Xfwm support composite, but need to be enabled by hand.<br />
=== Compiz === <!--T:54--><br />
<br />
0.9 series compiz can disable composite. You can use ccsm to configure it.<br />
=== Other window manager === <!--T:55--><br />
<br />
<!--T:56--><br />
You can use xcompmgr, cairo-compmgr as composite manager for them.<br />
<br />
== Minecraft == <!--T:12--><br />
<br />
<!--T:34--><br />
Original Minecraft under linux doesn't support input method, what make it worse is, XIM will conflict with its key event processing, one way to work around is, set a wrong environment variable on purpose for minecraft, then start up it. You can use following script to do that<br />
<br />
<!--T:35--><br />
<pre>#!/bin/sh<br />
# set a wrong one<br />
export XMODIFIERS="@im=null"<br />
# start minecraft, this might change depends on you're mod, but simply its what you ARE using to start minecraft.<br />
java -Xmx1024M -Xms512M -cp minecraft.jar net.minecraft.LauncherFrame</pre><br />
<br />
<!--T:58--><br />
This way can be also used, if you don't want fcitx to work on some application which is using XIM.<br />
<br />
<!--T:73--><br />
There is a mod can be used to support input under Linux, called [http://forum.minecraftuser.jp/viewtopic.php?t=6279 NihongoMOD], 1.2.2 with minecraft 1.5.2 can work with Fcitx without upper hack.<br />
<br />
== Root application under normal user X == <!--T:57--><br />
Root application under X normal user session is always broken (in general, not specific to fcitx), due to the fact that dbus is a user session only process. The only way to type in root application with normal fcitx is to use XIM, set GTK_IM_MODULE=xim and QT_IM_MODULE=xim before you start your application.<br />
<br />
== Cursor Following problem == <!--T:13--><br />
There is a common misunderstanding that it's input method's fault that input window could not follow the cursor, which is simply wrong. This is how cursor following works: Application send the position to Input method, then input method move the input window. So if application do not send the position, the position would be wrong. This behavior is controlled by application, but not input method. So if you meet any problem, please ask application to fix it, don't ask input method to do anything. Actually, input method could do nothing with this.<br />
<br />
<!--T:59--><br />
Although there is some walkaround for specific problem, bug is still in application, not in input method.<br />
<br />
<!--T:60--><br />
* Opera, enable on the spot for [[Special:MyLanguage/XIM|XIM]].<br />
* Firefox, enable preedit.<br />
<br />
== Colored Emoji ==<br />
The issue itself is usually not relevant to Fcitx itself, but the library used to render text. When using X11, or using native wayland input method protocol, the text is rendered by pango, which is the same as Gtk. You can also check if Gtk application is fine with such emoji character. A common issue is that, the embedded bitmap font is disabled by fontconfig, which is required to display color emoji.<br />
<br />
As for Wayland that uses "Client side input panel" feature, the text is rendered natively by the toolkit. If it is a Qt application, which you may hit some Qt bugs: https://bugreports.qt.io/browse/QTBUG-80434 , https://bugreports.qt.io/browse/QTBUG-85744 , which does not have a resolution yet.<br />
<br />
<!--T:14--><br />
[[Category:How-to]]<br />
<br />
</translate></div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Donate&diff=45991Donate2024-01-05T20:50:08Z<p>Weng Xuetian: </p>
<hr />
<div><languages/><br />
<br />
<translate><br />
<br />
<!--T:2--><br />
All Fcitx developers are using their spare time to develop Fcitx. So some money will be a great encourage for them.<br />
<br />
<!--T:3--><br />
Currently, we don't have a concentrated account to raise money, so the only way to donate to Fcitx is to donate to individual developer.<br />
<br />
== Developer == <!--T:6--><br />
<br />
=== CSSlayer === <!--T:7--><br />
Check this page on my personal blog: [https://www.csslayer.info/wordpress/donation/]<br />
<br />
</translate></div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&diff=45990Setup Fcitx 5/zh-cn2023-12-07T13:06:23Z<p>Weng Xuetian: </p>
<hr />
<div><languages /><br />
= 开机自启动 =<br />
<br />
== 特定发行版中的工具 ==<br />
<br />
特定的发行版可能会提供一些用于自动启动 Fcitx 的工具,并且这些工具通常也会设置环境变量。<br />
<br />
=== im-config (Debian/Debian-based/Ubuntu) ===<br />
这是一个用于 Debian 和 Debian-based 发行版的工具。在登录到 GUI 之后,从命令行执行 <code>im-config</code>,应该会弹出一个向导程序,在其中选择 fcitx5 即可。<br />
<br />
=== imsettings (Fedora) ===<br />
这是一个与 im-config 类似的程序,它也提供了 GUI 来选择要使用的输入法框架。imsettings 应该是被默认安装的,如果没有,你可以手动安装它。imsettings 可以设置环境变量并且启动相应的输入法,它还提供了一个图形化的前端用于修改配置。你需要做的就是简单地执行<code>im-chooser</code>,log-out 然后再次 log-in。<br />
<br />
[https://www.youtube.com/watch?v=FwqTtGEN4vQ 针对 Fedora 36 KDE 的操作说明]。 这个操作说明应该适用于除 GNOME 外的 XDG 兼容桌面。<br />
<br />
=== fcitx5-autostart (Fedora) ===<br />
这是一个 [fedora 软件包],打包了一个用于设置环境变量和 XDG autostart file 的 /etc/profile.d 脚本,可用于自启动。<br />
<br />
== XDG Autostart ==<br />
<br />
特定的发行版可能没有提供这个文件,如未提供,你可以直接复制 <code>/usr/share/applications/org.fcitx.Fcitx5.desktop</code> 到 <code>~/.config/autostart</code><br />
<br />
<nowiki>mkdir -p ~/.config/autostart && cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart</nowiki><br />
<br />
== KWin Wayland 5.24+ ==<br />
如果你只使用 Gtk/Qt/Xwayland 应用,那么你不需要这里的操作。如果你希望使用支持 text-input-v3 的原生 wayland 应用,则需要让 KWin 将输入法作为一个特殊的客户端启动。<br />
<br />
打开 systemsettings,转到 "Virtual Keyboard" 部分,将输入法从 "None" 改为 "Fcitx 5"<br />
<br />
== 非 XDG 兼容的窗口管理器/Wayland Compoistor ==<br />
<br />
在不支持 XDG Autostart 的场景中,请检查你的窗口管理器的手册中关于如何在系统启动时自动运行应用程序的方法。<br />
<br />
=== Weston ===<br />
Weston 是一个 wayland compositor 的参考实现,并不是普通用户的常规配置。<br />
<br />
如果你希望使用 westons zwp_input_method_v1 实现,你需要确保以下内容存在 ~/.config/weston.ini 文件中(如果路径不是 /usr/bin/fcitx5 请做相应修改)。<br />
<br />
<nowiki>[input-method]<br />
path=/usr/bin/fcitx5</nowiki><br />
<br />
如果你已经在同一个会话中运行 fcitx5,当你为了调试和 fcitx5 尝试在 nested mode 中使用 weston 时,会存在特定的问题。<br />
<br />
如果你出于调试目的只在 X11 中运行 weston,最简单的方法是在启动 weston 前退出 fcitx5.<br />
<br />
另请注意,weston 有一个 bug,在首次运行时不会正确设置 DISPLAY 为输入法。您可能需要终止 fcitx5 一次才能使其正确设置 DISPLAY,或使用 OpenX11Connection dbus 调用来连接 fcitx。<br />
<br />
= Environment variables =<br />
<br />
Due to the transition phase in a lot of different places, there is no perfect solution that works for every one. Please choose your own solution based on your environment. Basically what you want to do is to set following environment variables for your desktop session. <br />
<nowiki><br />
XMODIFIERS=@im=fcitx<br />
GTK_IM_MODULE=fcitx<br />
QT_IM_MODULE=fcitx</nowiki><br />
Though it looks like valid shell script, please *NOTE* that the snippet above is just to demonstrate what these value gonna be. Please check the section below for concrete syntax for different methods.<br />
<br />
== Login shell profile ==<br />
If you are using Bash as your login shell, <code>~/.bash_profile</code> is the best user-level thing you can rely on. It is widely supported by different DMs and will also work if you start graphics from TTY.<br />
<br />
* Supported by mainstream Display manager, including GDM/SDDM/LightDM<br />
* TTY login<br />
<br />
If you are not using bash, you may want to double check if your shell profile can be used as a place to set environment variables, especially you are using some uncommon login shells. <br />
<br />
The snippet that you need to add to <code>~/.bash_profile</code> would be<br />
<nowiki><br />
export XMODIFIERS=@im=fcitx<br />
export GTK_IM_MODULE=fcitx<br />
export QT_IM_MODULE=fcitx</nowiki><br />
<br />
Some may argue that <code>~/.profile</code> is a shell agnostic solution, which is wrong. While GDM always source this file, SDDM/Bash would not source this file if <code>~/.bash_profile</code> presents. This makes <code>~/.bash_profile</code> a better solution because bash is quite widely used. But check your login shell before proceeding, some distribution may not use bash as default shell.<br />
<br />
此[https://youtu.be/8XDmLr6wb4M 视频]演示了如何在 Archlinux 上手动设置环境变量<br />
<br />
== /etc/profile ==<br />
Best option if you does not care about modifying a file with root. This file is generally supported by all distribution. The code snippet that you need to append to the end of <code>/etc/profile</code> is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].<br />
<br />
== ~/.xprofile ==<br />
An old perfect option if you are using X11 and display manager. But there is no counterpart for Wayland, so it is not ideal if you want to set environment variable for Wayland. The code that you want to add is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].<br />
<br />
== environment.d ==<br />
This is a new configuration that introduced by system.d, but not widely used supported by desktop environment or display manager. It is basically the environment configuration for systemd user unit. Currently, it is only supported by GDM or Plasma 5.22+. As GDM, it means any session that login with GDM will work. As for Plasma, it means it works for Plasma regardless what DM you are using.<br />
<br />
This configuration is applied upon your first user session login and persist afterwards unless you manually stop the systemd user. So after you modifies this configuration, the easiest way to make it effective is to reboot your system.<br />
<br />
The syntax is similar to shell, but no <code>export</code> is required. For example, you can create a file <code>~/.config/environment.d/im.conf</code> with following content:<br />
<nowiki><br />
XMODIFIERS=@im=fcitx<br />
GTK_IM_MODULE=fcitx<br />
QT_IM_MODULE=fcitx</nowiki><br />
<br />
== pam_env.so ==<br />
This is an obsolete solution for following reasons:<br />
* pam deprecate user level configuration <code>~/.pam_environment</code> since 1.5.0.<br />
* Some distribution does not enable pam_env in their pam configuration.<br />
<br />
If you know it works for your system, you can put following snippet to your <code>~/.pam_environment</code>.<br />
<nowiki>XMODIFIERS DEFAULT=\@im=fcitx<br />
GTK_IM_MODULE DEFAULT=fcitx<br />
QT_IM_MODULE DEFAULT=fcitx</nowiki>.<br />
<br />
Please '''NOTE''' that the syntax is different from shell script.<br />
<br />
== ~/.config/plasma-workspace/env/*.sh ==<br />
A env script location that only works for Plasma desktop, you need to create your own .sh file, e.g. <code>~/.config/plasma-workspace/env/im.sh</code> and put the code snippet same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].<br />
<br />
== Other less common setup ==<br />
There are some other variable that might be useful certain applications.<br />
=== SDL_IM_MODULE ===<br />
Set the value to fcitx. Only SDL2 requires this. SDL1 uses XIM.<br />
=== GLFW_IM_MODULE ===<br />
This is a variable only used by [https://github.com/kovidgoyal/kitty/ kitty]. You need to set it to `GLFW_IM_MODULE=ibus`.<br />
=== Binary Qt application ===<br />
Due to Qt 5 does not support XIM, and it only bundles ibus im module, you may want to set `QT_IM_MODULE=ibus` for Qt application that does not use your system Qt library. (It may still not work because certain Qt application does not even bundle any im module). <br />
<br />
= DBus =<br />
On most distribution that ships with systemd, this should no longer be an issue. But if you are using some so called "systemd" free distribution, you may need to start DBus yourself and set the relevant environment variables. Usually, this can be done by adding a line in like this in your start up script. E.g. ~/.xprofile if you are using X11. Also you need to make sure this syntax works for your login shell. <br />
<br />
<nowiki>eval `dbus-launch --sh-syntax --exit-with-session`</nowiki><br />
<br />
= Configure Fcitx 5 =<br />
<br />
See [[Special:myLanguage/Configtool (Fcitx 5)|Configtool (Fcitx 5)]].</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/6/zh-cn&diff=45989Translations:Setup Fcitx 5/6/zh-cn2023-12-07T13:06:23Z<p>Weng Xuetian: </p>
<hr />
<div>[https://www.youtube.com/watch?v=FwqTtGEN4vQ 针对 Fedora 36 KDE 的操作说明]。 这个操作说明应该适用于除 GNOME 外的 XDG 兼容桌面。</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&diff=45988Setup Fcitx 5/zh-cn2023-12-07T12:54:32Z<p>Weng Xuetian: Created page with "此[https://youtu.be/8XDmLr6wb4M 视频]演示了如何在 Archlinux 上手动设置环境变量"</p>
<hr />
<div><languages /><br />
= 开机自启动 =<br />
<br />
== 特定发行版中的工具 ==<br />
<br />
特定的发行版可能会提供一些用于自动启动 Fcitx 的工具,并且这些工具通常也会设置环境变量。<br />
<br />
=== im-config (Debian/Debian-based/Ubuntu) ===<br />
这是一个用于 Debian 和 Debian-based 发行版的工具。在登录到 GUI 之后,从命令行执行 <code>im-config</code>,应该会弹出一个向导程序,在其中选择 fcitx5 即可。<br />
<br />
=== imsettings (Fedora) ===<br />
这是一个与 im-config 类似的程序,它也提供了 GUI 来选择要使用的输入法框架。imsettings 应该是被默认安装的,如果没有,你可以手动安装它。imsettings 可以设置环境变量并且启动相应的输入法,它还提供了一个图形化的前端用于修改配置。你需要做的就是简单地执行<code>im-chooser</code>,log-out 然后再次 log-in。<br />
<br />
[Video instruction for Fedora 36 KDE]. 这个向导应该适用于除 GNOME 外的 XDG 兼容桌面。<br />
<br />
=== fcitx5-autostart (Fedora) ===<br />
这是一个 [fedora 软件包],打包了一个用于设置环境变量和 XDG autostart file 的 /etc/profile.d 脚本,可用于自启动。<br />
<br />
== XDG Autostart ==<br />
<br />
特定的发行版可能没有提供这个文件,如未提供,你可以直接复制 <code>/usr/share/applications/org.fcitx.Fcitx5.desktop</code> 到 <code>~/.config/autostart</code><br />
<br />
<nowiki>mkdir -p ~/.config/autostart && cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart</nowiki><br />
<br />
== KWin Wayland 5.24+ ==<br />
如果你只使用 Gtk/Qt/Xwayland 应用,那么你不需要这里的操作。如果你希望使用支持 text-input-v3 的原生 wayland 应用,则需要让 KWin 将输入法作为一个特殊的客户端启动。<br />
<br />
打开 systemsettings,转到 "Virtual Keyboard" 部分,将输入法从 "None" 改为 "Fcitx 5"<br />
<br />
== 非 XDG 兼容的窗口管理器/Wayland Compoistor ==<br />
<br />
在不支持 XDG Autostart 的场景中,请检查你的窗口管理器的手册中关于如何在系统启动时自动运行应用程序的方法。<br />
<br />
=== Weston ===<br />
Weston 是一个 wayland compositor 的参考实现,并不是普通用户的常规配置。<br />
<br />
如果你希望使用 westons zwp_input_method_v1 实现,你需要确保以下内容存在 ~/.config/weston.ini 文件中(如果路径不是 /usr/bin/fcitx5 请做相应修改)。<br />
<br />
<nowiki>[input-method]<br />
path=/usr/bin/fcitx5</nowiki><br />
<br />
如果你已经在同一个会话中运行 fcitx5,当你为了调试和 fcitx5 尝试在 nested mode 中使用 weston 时,会存在特定的问题。<br />
<br />
如果你出于调试目的只在 X11 中运行 weston,最简单的方法是在启动 weston 前退出 fcitx5.<br />
<br />
另请注意,weston 有一个 bug,在首次运行时不会正确设置 DISPLAY 为输入法。您可能需要终止 fcitx5 一次才能使其正确设置 DISPLAY,或使用 OpenX11Connection dbus 调用来连接 fcitx。<br />
<br />
= Environment variables =<br />
<br />
Due to the transition phase in a lot of different places, there is no perfect solution that works for every one. Please choose your own solution based on your environment. Basically what you want to do is to set following environment variables for your desktop session. <br />
<nowiki><br />
XMODIFIERS=@im=fcitx<br />
GTK_IM_MODULE=fcitx<br />
QT_IM_MODULE=fcitx</nowiki><br />
Though it looks like valid shell script, please *NOTE* that the snippet above is just to demonstrate what these value gonna be. Please check the section below for concrete syntax for different methods.<br />
<br />
== Login shell profile ==<br />
If you are using Bash as your login shell, <code>~/.bash_profile</code> is the best user-level thing you can rely on. It is widely supported by different DMs and will also work if you start graphics from TTY.<br />
<br />
* Supported by mainstream Display manager, including GDM/SDDM/LightDM<br />
* TTY login<br />
<br />
If you are not using bash, you may want to double check if your shell profile can be used as a place to set environment variables, especially you are using some uncommon login shells. <br />
<br />
The snippet that you need to add to <code>~/.bash_profile</code> would be<br />
<nowiki><br />
export XMODIFIERS=@im=fcitx<br />
export GTK_IM_MODULE=fcitx<br />
export QT_IM_MODULE=fcitx</nowiki><br />
<br />
Some may argue that <code>~/.profile</code> is a shell agnostic solution, which is wrong. While GDM always source this file, SDDM/Bash would not source this file if <code>~/.bash_profile</code> presents. This makes <code>~/.bash_profile</code> a better solution because bash is quite widely used. But check your login shell before proceeding, some distribution may not use bash as default shell.<br />
<br />
此[https://youtu.be/8XDmLr6wb4M 视频]演示了如何在 Archlinux 上手动设置环境变量<br />
<br />
== /etc/profile ==<br />
Best option if you does not care about modifying a file with root. This file is generally supported by all distribution. The code snippet that you need to append to the end of <code>/etc/profile</code> is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].<br />
<br />
== ~/.xprofile ==<br />
An old perfect option if you are using X11 and display manager. But there is no counterpart for Wayland, so it is not ideal if you want to set environment variable for Wayland. The code that you want to add is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].<br />
<br />
== environment.d ==<br />
This is a new configuration that introduced by system.d, but not widely used supported by desktop environment or display manager. It is basically the environment configuration for systemd user unit. Currently, it is only supported by GDM or Plasma 5.22+. As GDM, it means any session that login with GDM will work. As for Plasma, it means it works for Plasma regardless what DM you are using.<br />
<br />
This configuration is applied upon your first user session login and persist afterwards unless you manually stop the systemd user. So after you modifies this configuration, the easiest way to make it effective is to reboot your system.<br />
<br />
The syntax is similar to shell, but no <code>export</code> is required. For example, you can create a file <code>~/.config/environment.d/im.conf</code> with following content:<br />
<nowiki><br />
XMODIFIERS=@im=fcitx<br />
GTK_IM_MODULE=fcitx<br />
QT_IM_MODULE=fcitx</nowiki><br />
<br />
== pam_env.so ==<br />
This is an obsolete solution for following reasons:<br />
* pam deprecate user level configuration <code>~/.pam_environment</code> since 1.5.0.<br />
* Some distribution does not enable pam_env in their pam configuration.<br />
<br />
If you know it works for your system, you can put following snippet to your <code>~/.pam_environment</code>.<br />
<nowiki>XMODIFIERS DEFAULT=\@im=fcitx<br />
GTK_IM_MODULE DEFAULT=fcitx<br />
QT_IM_MODULE DEFAULT=fcitx</nowiki>.<br />
<br />
Please '''NOTE''' that the syntax is different from shell script.<br />
<br />
== ~/.config/plasma-workspace/env/*.sh ==<br />
A env script location that only works for Plasma desktop, you need to create your own .sh file, e.g. <code>~/.config/plasma-workspace/env/im.sh</code> and put the code snippet same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].<br />
<br />
== Other less common setup ==<br />
There are some other variable that might be useful certain applications.<br />
=== SDL_IM_MODULE ===<br />
Set the value to fcitx. Only SDL2 requires this. SDL1 uses XIM.<br />
=== GLFW_IM_MODULE ===<br />
This is a variable only used by [https://github.com/kovidgoyal/kitty/ kitty]. You need to set it to `GLFW_IM_MODULE=ibus`.<br />
=== Binary Qt application ===<br />
Due to Qt 5 does not support XIM, and it only bundles ibus im module, you may want to set `QT_IM_MODULE=ibus` for Qt application that does not use your system Qt library. (It may still not work because certain Qt application does not even bundle any im module). <br />
<br />
= DBus =<br />
On most distribution that ships with systemd, this should no longer be an issue. But if you are using some so called "systemd" free distribution, you may need to start DBus yourself and set the relevant environment variables. Usually, this can be done by adding a line in like this in your start up script. E.g. ~/.xprofile if you are using X11. Also you need to make sure this syntax works for your login shell. <br />
<br />
<nowiki>eval `dbus-launch --sh-syntax --exit-with-session`</nowiki><br />
<br />
= Configure Fcitx 5 =<br />
<br />
See [[Special:myLanguage/Configtool (Fcitx 5)|Configtool (Fcitx 5)]].</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/28/zh-cn&diff=45987Translations:Setup Fcitx 5/28/zh-cn2023-12-07T12:54:32Z<p>Weng Xuetian: Created page with "此[https://youtu.be/8XDmLr6wb4M 视频]演示了如何在 Archlinux 上手动设置环境变量"</p>
<hr />
<div>此[https://youtu.be/8XDmLr6wb4M 视频]演示了如何在 Archlinux 上手动设置环境变量</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Using_Fcitx_5_on_Wayland&diff=45896Using Fcitx 5 on Wayland2023-11-16T20:43:16Z<p>Weng Xuetian: /* Per-window input method state */</p>
<hr />
<div>[https://wayland.freedesktop.org/ Wayland] is the next generation of display server protocol. While the initial release of the protocol is in 2008, the support of input method is not really ideal.<br />
<br />
Also, using input method on Wayland-based compositor may require different setup to make it work, and certain features of fcitx that works under X11 are not yet supported by Wayland.<br />
<br />
This page will try to cover all the current information with some underlying details, and [[Special:MyLanguage/Setup Fcitx 5|Setup Fcitx 5]] is still generally useful.<br />
<br />
== Applications ==<br />
=== TL;DR Do we still need XMODIFIERS, GTK_IM_MODULE and QT_IM_MODULE? ===<br />
For XMODIFIERS, yes, we do. X11 application running under X11 and XWayland has nearly no difference.<br />
<br />
For GTK_IM_MODULE, as for now, the modern Gtk 3/4 application should be able to use text-input-v3 which is supported almost by every compositor, except weston. There are a few different options in terms of setting the value of GTK_IM_MODULE. When it is unset, the Gtk built-in Wayland im module will be used for Gtk3 and Gtk4. While you can also enforce it by doing GTK_IM_MODULE=wayland, remember it will be also picked up by Gtk2. Setting GTK_IM_MODULE=fcitx can still work, and it is necessary if your compositor does not support Wayland input method frontend.<br />
<br />
For QT_IM_MODULE, as for now QT can only use its own text-input-v{2,4}, which is only supported by KWin. Which means, under KDE you should unset it, but under other desktop, you will need to set it to QT_IM_MODULE=fcitx. Also the proprietary Qt applications in the wild complicates the situation. Some do not work on Wayland, some do not bundle/provide Qt wayland. Most of them do not bundle fcitx im module because fcitx is only a third party application to Qt, but I also noticed some do bundle but not bundle all the required libraries. While fcitx 5 support ibus protocol, some of those applications do not even bundle ibus im module. There are a few different environment variables you can try for those proprietary Qt applications (WPS, Anki, DaVinci Resolve, Mathematica, etc...).<br />
<br />
<nowiki>QT_IM_MODULE=fcitx # For those who bundle qt im module, e.g. WPS, Anki, you should find a .so file with fcitx in the file name<br />
QT_IM_MODULE=ibus # For those who bundle ibus im module shipped with Qt, you should find libibusplatforminputcontextplugin.so in the package.<br />
QT_QPA_PLATFORM=xcb QT_IM_MODULE=ibus # Enforce it to run on X11/XWayland and use ibus im module<br />
</nowiki><br />
<br />
=== Legacy X11 application that runs under XWayland ===<br />
In a word, XWayland support for input method is as good as normal X11 display server. As long as you set the same environment variable, using Xwayland should not be a issue. This category includes: <br />
<br />
* Xlib-based (and also other toolkit based on Xlib, e.g. tk, SDL1, etc), e.g. xterm, rxvt. Make sure XMODIFIERS is set correctly.<br />
* Gtk2-based applications, similar to Xlib, but can use fcitx im module. Set GTK_IM_MODULE to fcitx will give it best experience.<br />
* SDL2-based applications that doesn't default to wayland. Set SDL_IM_MODULE to fcitx<br />
* electron, chromium, these are still default to X11, similar to Gtk2 case.<br />
* For Qt4 applcation, Qt 4 can only use X11. You will need to QT_IM_MODULE to fcitx. Same for Qt5+ that uses XCB (can be override with QT_QPA_PLATFORM=xcb).<br />
<br />
=== Gtk3 / Gtk4 ===<br />
Gtk3 and Gtk4 support text-input-v3 natively. At the same time, it's also possible to use fcitx im module under wayland. So, either GTK_IM_MODULE=wayland or GTK_IM_MODULE=fcitx works. There are some difference to it. text-input-v3<br />
<br />
=== Qt5 / Qt6 ===<br />
If your Qt application natively runs under Wayland, you can either unset QT_IM_MODULE to make it use text-input-v2, or set QT_IM_MODULE=fcitx to make it use fcitx im module.<br />
<br />
text-input-v2 is not upstreamed to wayland-protocols, that is probably why only kwin support it. This means in non-kwin environment, you will need to use QT_IM_MODULE=fcitx to make the Qt applications work.<br />
<br />
On Qt6, you may also use QT_IM_MODULE= (empty) or QT_IM_MODULE=wayland if your Qt vesion contains this https://codereview.qt-project.org/c/qt/qtwayland/+/416862.<br />
<br />
=== Native wayland application (winit) ===<br />
Most likely text-input-v3 is being used.<br />
<br />
=== Chromium / Electron ===<br />
{{warning|The information in this section may not be up to date to reflect upstream change, especially the default behavior when no option is changed.}}<br />
TL;DR version, if you use XWayland to run Chromium or Electron application, just install Gtk im module and GTK_IM_MODULE=fcitx the same way like X11.<br />
<br />
If you choose to run it natively under Wayland, for chromium you will need to use<br />
<br />
# If your compositor supports text-input-v1 protocol. Check the compositor section below.<br />
chromium --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime <br />
<br />
Or<br />
<br />
# You will get wrong position for the input method popup window, unless you use GNOME shell + kimpanel extension.<br />
chromium --enable-features=UseOzonePlatform --ozone-platform=wayland --gtk-version=4 <br />
<br />
For electron, only the first option is avaiable (electron does NOT support to run internal chromium with gtk4), e.g. for vscode<br />
<br />
# If your compositor supports text-input-v1 protocol. Check the compositor section below.<br />
code --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime<br />
<br />
By default it should run under Xwayland (As of 2023/02/25 on Archlinux/Chromium 110.0.5481.177), but some user also reports it is using wayland even the "Preferred Ozone Platform" is "Default". So to check whether it's really run with wayland, you can use xeyes or xwininfo. With xeyes, if it's an X11 window, the "eyes" will move with mouse, otherwise it's wayland. With xwininfo, if the mouse cursor changed to "+" shape, and click the window shows the window information, then it is a X11 window.<br />
<br />
You may force it to run with Wayland, or X11 with the flag <code>--ozone-platform=wayland</code> and <code>--ozone-platform=x11</code>. You may persistent this by changing the option "Preferred Ozone Platform" in chrome://flags. It has four values, "Default", "X11", "Wayland", "Auto".<br />
<br />
It's possible to make it use GTK_IM_MODULE if it runs with Gtk4 (only supported by chromium/chrome at this time, not electron) by passing <code>--gtk-version=4</code>.<br />
<br />
It's also possible to make it use text-input-v1 by passing <code>--enable-wayland-ime</code> in addition to the flag above.<br />
<br />
The Chromium support for text-input-v1 is not very stable and you may hit some random crash. E.g. in the past, version 112 has a crash bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1431532 , which is fixed in version 115. In the bug comment, Chromium developer claims this text-input-v1 is only supposed to be used internally and not well supported, so use this at your own risk though it's currently the only out of box option. <br />
<br />
You should only use one of <code>--enable-wayland-ime</code> or <code>--gtk-version=4</code>, depending on you want to use text-input-v1, or gtk4 im module. text-input-v1 works for kwin 5.27 and weston. Gtk4 im module works on all environment, but only GNOME with Kimpanel extension can display the popup window in the correct position.<br />
<br />
== Support in Wayland Compositor ==<br />
<br />
Even if you are using only native wayland applications, Xwayland is recommended to be enabled for following reason. If client side input panel in im module does not work, fcitx will fallback to a X11 window, instead of a wayland window. The reason for this is because wayland window can not be placed freely on the screen. On the contrary, even if im module can only pass a coordinate relative to the application window to fcitx, which make the coordinate position doesn't make much sense, if your application window size is "maximized", the coordinate may just be "right" if treated as the global coordinate. This makes X11 window a better option than a randomly placed wayland window.<br />
<br />
=== KDE Plasma ===<br />
Best setup:<br />
* KDE Plasma 5.27<br />
* Environment variables:<br />
** Set <code>XMODIFIERS=@im=fcitx</code> for XWayland application<br />
** Start fcitx5 by go to "System settings" -> "Virtual keyboard" -> Select Fcitx 5<br />
** Do not set GTK_IM_MODULE & QT_IM_MODULE & SDL_IM_MODULE<br />
** Run chromium/electron application with <code>--enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime</code><br />
* Caveats:<br />
** Certain Gtk/Qt application that only works under X11 may still need to set GTK_IM_MODULE or QT_IM_MODULE for them individually.<br />
** If you set GTK_IM_MODULE/QT_IM_MODULE globally, you will hit this issue [[Special:MyLanguage/FAQ#Candidate_window_is_blinking_under_wayland_with_Fcitx_5|Candidate window is blinking under wayland with Fcitx 5]]<br />
<br />
Support Information:<br />
* App/Compositor supports text-input-v2 and text-input-v3.<br />
* Comopositor/Application uses zwp_input_method_v1. <br />
* 5.27 additionally supports text-input-v1.<br />
* 5.24 usable zwp_input_method_v1 with fcitx5. Pre-5.24 there are lots of problems, always use fcitx im module instead.<br />
* Use "Virtual keyboard" KCM to launch fcitx5. This is required to use text-input protocol. If you launch fcitx this way, make sure you do not use "restart" in the tray menu, since the socket passed from KWin can not be reused with the newly restarted fcitx.<br />
<br />
=== GNOME ===<br />
Best setup:<br />
* Environment variables:<br />
** Set <code>XMODIFIERS=@im=fcitx</code> for XWayland application<br />
** Set <code>QT_IM_MODULE=fcitx</code> for Qt, since Qt5 would use XWayland by default.<br />
** Run chrome with XWayland and <code>GTK_IM_MODULE=fcitx</code><br />
<br />
Support information:<br />
* Application/Compositor uses text-input-v3<br />
* Compositor/Input Method uses ibus dbus protocol, so ibus frontend is required to be used.<br />
* Adding Fcitx 5 to autostart, it will replace any existing ibus-daemon upon start up so it will work out of box.<br />
* Popup candidate window is not able to be displayed over gnome-shell UI. Only solution is to use [[Special:MyLanguage/Kimpanel|Kimpanel]], [https://extensions.gnome.org/extension/261/kimpanel/ link to extension].<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Sway ===<br />
* Application/Compositor uses text-input-v3<br />
* Comopositor/Application uses zwp_input_method_v2, but it's partially implemented. You will need [https://github.com/swaywm/sway/pull/7226 this pull request] to make it show the popup candidate window for text-input-v3 client.<br />
* fcitx im module also works.<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Weston ===<br />
* Application/Compositor uses text-input-v1<br />
* Comopositor/Application uses zwp_input_method_v1.<br />
* Since it has no text-input-v3, which is more commonly used, im module is the only solution for Gtk/Qt, need to set GTK_IM_MODULE=fcitx and QT_IM_MODULE=fcitx.<br />
* Add following content to ~/.config/weston.ini to make it launch fcitx 5. (xwayland part is recommended to make fcitx work best, even if it's wayland)<br />
<br />
<pre><br />
[core]<br />
xwayland=true<br />
<br />
[input-method]<br />
path=/usr/bin/fcitx5<br />
</pre><br />
<br />
=== Other compositors ===<br />
Please check their upstream for more information. For wlroots based compositors, it is possible that they also support in the same way as Sway does, or zwp_input_method could also be unsupported.<br />
<br />
== Known Issues ==<br />
=== Fcitx managed XKB layout ===<br />
Unlike X11, there is no generic way to set XKB layout to compositor, which means it can only be implemented for every individual desktop. Right now, Fcitx managed layout only works for KDE Plasma and GNOME.<br />
<br />
As for other desktop, in order to make this "semi" work you'll need to ensure following:<br />
<br />
* The XKB layout of the input method group should be the same as the actual xkb layout you configured for the compositor. Fcitx will "think" the layout is the same and bypass the key conversion logic.<br />
* If you need other layout for text typing (e.g. Arabic), just add them to the Fcitx. As long as the key is forwarded to fcitx, it should work.<br />
<br />
=== Popup candidate window ===<br />
Wayland does not have a global coordinate system for regular client, so for native wayland client, it is impossible for Fcitx to place a wayland surface at a certain position. In order for popup window to be placed at the correct position, there are following cases:<br />
* Xwayland have no problem and it should work as good as X11.<br />
* If zwp_input_method protocol can be used, it has a surface role to allow compositor to place the popup window for input method. This only works if client uses text-input protocol.<br />
* For GNOME, kimpanel extension can read window coordinate since it's running inside compositor. As long as im module can report relative coordinate, kimpanel extension can display the popup window at the correct position. As similar approach for Plasma kimpanel is planned, but not yet implemented.<br />
* For Gtk/Qt, fcitx's im module implement a way to render the popup with in the client process. This has some limitation because implemenation of xdg_popup in Gtk3/Qt5 doesn't support reposition the window. So show/hide trick is used to mitigate this, but it may cause window blinking. Fcitx tries not to move window if possible. You may also disable popup animation if you're using KWin to help reduce the blinking.<br />
<br />
=== Per-window input method state ===<br />
When zwp_input_method is used, essentially there is only one input context visible to fcitx, and fcitx cannot distinguish what application is being used. Which means the input method "active"/"inactivate" state is now "global".<br />
<br />
Now fcitx supports two protocol to figure out the focused window and the corresponding application name, including wlr-foreign-toplevel-management (used by wlroots based compositor) and plasma-window-management (used by kwin).</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Using_Fcitx_5_on_Wayland&diff=45875Using Fcitx 5 on Wayland2023-10-19T05:57:49Z<p>Weng Xuetian: </p>
<hr />
<div>[https://wayland.freedesktop.org/ Wayland] is the next generation of display server protocol. While the initial release of the protocol is in 2008, the support of input method is not really ideal.<br />
<br />
Also, using input method on Wayland-based compositor may require different setup to make it work, and certain features of fcitx that works under X11 are not yet supported by Wayland.<br />
<br />
This page will try to cover all the current information with some underlying details, and [[Special:MyLanguage/Setup Fcitx 5|Setup Fcitx 5]] is still generally useful.<br />
<br />
== Applications ==<br />
=== TL;DR Do we still need XMODIFIERS, GTK_IM_MODULE and QT_IM_MODULE? ===<br />
For XMODIFIERS, yes, we do. X11 application running under X11 and XWayland has nearly no difference.<br />
<br />
For GTK_IM_MODULE, as for now, the modern Gtk 3/4 application should be able to use text-input-v3 which is supported almost by every compositor, except weston. There are a few different options in terms of setting the value of GTK_IM_MODULE. When it is unset, the Gtk built-in Wayland im module will be used for Gtk3 and Gtk4. While you can also enforce it by doing GTK_IM_MODULE=wayland, remember it will be also picked up by Gtk2. Setting GTK_IM_MODULE=fcitx can still work, and it is necessary if your compositor does not support Wayland input method frontend.<br />
<br />
For QT_IM_MODULE, as for now QT can only use its own text-input-v{2,4}, which is only supported by KWin. Which means, under KDE you should unset it, but under other desktop, you will need to set it to QT_IM_MODULE=fcitx. Also the proprietary Qt applications in the wild complicates the situation. Some do not work on Wayland, some do not bundle/provide Qt wayland. Most of them do not bundle fcitx im module because fcitx is only a third party application to Qt, but I also noticed some do bundle but not bundle all the required libraries. While fcitx 5 support ibus protocol, some of those applications do not even bundle ibus im module. There are a few different environment variables you can try for those proprietary Qt applications (WPS, Anki, DaVinci Resolve, Mathematica, etc...).<br />
<br />
<nowiki>QT_IM_MODULE=fcitx # For those who bundle qt im module, e.g. WPS, Anki, you should find a .so file with fcitx in the file name<br />
QT_IM_MODULE=ibus # For those who bundle ibus im module shipped with Qt, you should find libibusplatforminputcontextplugin.so in the package.<br />
QT_QPA_PLATFORM=xcb QT_IM_MODULE=ibus # Enforce it to run on X11/XWayland and use ibus im module<br />
</nowiki><br />
<br />
=== Legacy X11 application that runs under XWayland ===<br />
In a word, XWayland support for input method is as good as normal X11 display server. As long as you set the same environment variable, using Xwayland should not be a issue. This category includes: <br />
<br />
* Xlib-based (and also other toolkit based on Xlib, e.g. tk, SDL1, etc), e.g. xterm, rxvt. Make sure XMODIFIERS is set correctly.<br />
* Gtk2-based applications, similar to Xlib, but can use fcitx im module. Set GTK_IM_MODULE to fcitx will give it best experience.<br />
* SDL2-based applications that doesn't default to wayland. Set SDL_IM_MODULE to fcitx<br />
* electron, chromium, these are still default to X11, similar to Gtk2 case.<br />
* For Qt4 applcation, Qt 4 can only use X11. You will need to QT_IM_MODULE to fcitx. Same for Qt5+ that uses XCB (can be override with QT_QPA_PLATFORM=xcb).<br />
<br />
=== Gtk3 / Gtk4 ===<br />
Gtk3 and Gtk4 support text-input-v3 natively. At the same time, it's also possible to use fcitx im module under wayland. So, either GTK_IM_MODULE=wayland or GTK_IM_MODULE=fcitx works. There are some difference to it. text-input-v3<br />
<br />
=== Qt5 / Qt6 ===<br />
If your Qt application natively runs under Wayland, you can either unset QT_IM_MODULE to make it use text-input-v2, or set QT_IM_MODULE=fcitx to make it use fcitx im module.<br />
<br />
text-input-v2 is not upstreamed to wayland-protocols, that is probably why only kwin support it. This means in non-kwin environment, you will need to use QT_IM_MODULE=fcitx to make the Qt applications work.<br />
<br />
On Qt6, you may also use QT_IM_MODULE= (empty) or QT_IM_MODULE=wayland if your Qt vesion contains this https://codereview.qt-project.org/c/qt/qtwayland/+/416862.<br />
<br />
=== Native wayland application (winit) ===<br />
Most likely text-input-v3 is being used.<br />
<br />
=== Chromium / Electron ===<br />
{{warning|The information in this section may not be up to date to reflect upstream change, especially the default behavior when no option is changed.}}<br />
TL;DR version, if you use XWayland to run Chromium or Electron application, just install Gtk im module and GTK_IM_MODULE=fcitx the same way like X11.<br />
<br />
If you choose to run it natively under Wayland, for chromium you will need to use<br />
<br />
# If your compositor supports text-input-v1 protocol. Check the compositor section below.<br />
chromium --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime <br />
<br />
Or<br />
<br />
# You will get wrong position for the input method popup window, unless you use GNOME shell + kimpanel extension.<br />
chromium --enable-features=UseOzonePlatform --ozone-platform=wayland --gtk-version=4 <br />
<br />
For electron, only the first option is avaiable (electron does NOT support to run internal chromium with gtk4), e.g. for vscode<br />
<br />
# If your compositor supports text-input-v1 protocol. Check the compositor section below.<br />
code --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime<br />
<br />
By default it should run under Xwayland (As of 2023/02/25 on Archlinux/Chromium 110.0.5481.177), but some user also reports it is using wayland even the "Preferred Ozone Platform" is "Default". So to check whether it's really run with wayland, you can use xeyes or xwininfo. With xeyes, if it's an X11 window, the "eyes" will move with mouse, otherwise it's wayland. With xwininfo, if the mouse cursor changed to "+" shape, and click the window shows the window information, then it is a X11 window.<br />
<br />
You may force it to run with Wayland, or X11 with the flag <code>--ozone-platform=wayland</code> and <code>--ozone-platform=x11</code>. You may persistent this by changing the option "Preferred Ozone Platform" in chrome://flags. It has four values, "Default", "X11", "Wayland", "Auto".<br />
<br />
It's possible to make it use GTK_IM_MODULE if it runs with Gtk4 (only supported by chromium/chrome at this time, not electron) by passing <code>--gtk-version=4</code>.<br />
<br />
It's also possible to make it use text-input-v1 by passing <code>--enable-wayland-ime</code> in addition to the flag above.<br />
<br />
The Chromium support for text-input-v1 is not very stable and you may hit some random crash. E.g. in the past, version 112 has a crash bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1431532 , which is fixed in version 115. In the bug comment, Chromium developer claims this text-input-v1 is only supposed to be used internally and not well supported, so use this at your own risk though it's currently the only out of box option. <br />
<br />
You should only use one of <code>--enable-wayland-ime</code> or <code>--gtk-version=4</code>, depending on you want to use text-input-v1, or gtk4 im module. text-input-v1 works for kwin 5.27 and weston. Gtk4 im module works on all environment, but only GNOME with Kimpanel extension can display the popup window in the correct position.<br />
<br />
== Support in Wayland Compositor ==<br />
<br />
Even if you are using only native wayland applications, Xwayland is recommended to be enabled for following reason. If client side input panel in im module does not work, fcitx will fallback to a X11 window, instead of a wayland window. The reason for this is because wayland window can not be placed freely on the screen. On the contrary, even if im module can only pass a coordinate relative to the application window to fcitx, which make the coordinate position doesn't make much sense, if your application window size is "maximized", the coordinate may just be "right" if treated as the global coordinate. This makes X11 window a better option than a randomly placed wayland window.<br />
<br />
=== KDE Plasma ===<br />
Best setup:<br />
* KDE Plasma 5.27<br />
* Environment variables:<br />
** Set <code>XMODIFIERS=@im=fcitx</code> for XWayland application<br />
** Start fcitx5 by go to "System settings" -> "Virtual keyboard" -> Select Fcitx 5<br />
** Do not set GTK_IM_MODULE & QT_IM_MODULE & SDL_IM_MODULE<br />
** Run chromium/electron application with <code>--enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime</code><br />
* Caveats:<br />
** Certain Gtk/Qt application that only works under X11 may still need to set GTK_IM_MODULE or QT_IM_MODULE for them individually.<br />
** If you set GTK_IM_MODULE/QT_IM_MODULE globally, you will hit this issue [[Special:MyLanguage/FAQ#Candidate_window_is_blinking_under_wayland_with_Fcitx_5|Candidate window is blinking under wayland with Fcitx 5]]<br />
<br />
Support Information:<br />
* App/Compositor supports text-input-v2 and text-input-v3.<br />
* Comopositor/Application uses zwp_input_method_v1. <br />
* 5.27 additionally supports text-input-v1.<br />
* 5.24 usable zwp_input_method_v1 with fcitx5. Pre-5.24 there are lots of problems, always use fcitx im module instead.<br />
* Use "Virtual keyboard" KCM to launch fcitx5. This is required to use text-input protocol. If you launch fcitx this way, make sure you do not use "restart" in the tray menu, since the socket passed from KWin can not be reused with the newly restarted fcitx.<br />
<br />
=== GNOME ===<br />
Best setup:<br />
* Environment variables:<br />
** Set <code>XMODIFIERS=@im=fcitx</code> for XWayland application<br />
** Set <code>QT_IM_MODULE=fcitx</code> for Qt, since Qt5 would use XWayland by default.<br />
** Run chrome with XWayland and <code>GTK_IM_MODULE=fcitx</code><br />
<br />
Support information:<br />
* Application/Compositor uses text-input-v3<br />
* Compositor/Input Method uses ibus dbus protocol, so ibus frontend is required to be used.<br />
* Adding Fcitx 5 to autostart, it will replace any existing ibus-daemon upon start up so it will work out of box.<br />
* Popup candidate window is not able to be displayed over gnome-shell UI. Only solution is to use [[Special:MyLanguage/Kimpanel|Kimpanel]], [https://extensions.gnome.org/extension/261/kimpanel/ link to extension].<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Sway ===<br />
* Application/Compositor uses text-input-v3<br />
* Comopositor/Application uses zwp_input_method_v2, but it's partially implemented. You will need [https://github.com/swaywm/sway/pull/7226 this pull request] to make it show the popup candidate window for text-input-v3 client.<br />
* fcitx im module also works.<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Weston ===<br />
* Application/Compositor uses text-input-v1<br />
* Comopositor/Application uses zwp_input_method_v1.<br />
* Since it has no text-input-v3, which is more commonly used, im module is the only solution for Gtk/Qt, need to set GTK_IM_MODULE=fcitx and QT_IM_MODULE=fcitx.<br />
* Add following content to ~/.config/weston.ini to make it launch fcitx 5. (xwayland part is recommended to make fcitx work best, even if it's wayland)<br />
<br />
<pre><br />
[core]<br />
xwayland=true<br />
<br />
[input-method]<br />
path=/usr/bin/fcitx5<br />
</pre><br />
<br />
=== Other compositors ===<br />
Please check their upstream for more information. For wlroots based compositors, it is possible that they also support in the same way as Sway does, or zwp_input_method could also be unsupported.<br />
<br />
== Known Issues ==<br />
=== Fcitx managed XKB layout ===<br />
Unlike X11, there is no generic way to set XKB layout to compositor, which means it can only be implemented for every individual desktop. Right now, Fcitx managed layout only works for KDE Plasma and GNOME.<br />
<br />
As for other desktop, in order to make this "semi" work you'll need to ensure following:<br />
<br />
* The XKB layout of the input method group should be the same as the actual xkb layout you configured for the compositor. Fcitx will "think" the layout is the same and bypass the key conversion logic.<br />
* If you need other layout for text typing (e.g. Arabic), just add them to the Fcitx. As long as the key is forwarded to fcitx, it should work.<br />
<br />
=== Popup candidate window ===<br />
Wayland does not have a global coordinate system for regular client, so for native wayland client, it is impossible for Fcitx to place a wayland surface at a certain position. In order for popup window to be placed at the correct position, there are following cases:<br />
* Xwayland have no problem and it should work as good as X11.<br />
* If zwp_input_method protocol can be used, it has a surface role to allow compositor to place the popup window for input method. This only works if client uses text-input protocol.<br />
* For GNOME, kimpanel extension can read window coordinate since it's running inside compositor. As long as im module can report relative coordinate, kimpanel extension can display the popup window at the correct position. As similar approach for Plasma kimpanel is planned, but not yet implemented.<br />
* For Gtk/Qt, fcitx's im module implement a way to render the popup with in the client process. This has some limitation because implemenation of xdg_popup in Gtk3/Qt5 doesn't support reposition the window. So show/hide trick is used to mitigate this, but it may cause window blinking. Fcitx tries not to move window if possible. You may also disable popup animation if you're using KWin to help reduce the blinking.<br />
<br />
=== Per-window input method state ===<br />
When zwp_input_method is used, essentially there is only one input context visible to fcitx, and fcitx cannot distinguish what application is being used. Which means the input method "active"/"inactivate" state is now "global".<br />
<br />
There is planned change to obtain the active application name and use "virtual" input context for wayland frontend. It's not yet in the stable version of Fcitx.</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Using_Fcitx_5_on_Wayland&diff=45874Using Fcitx 5 on Wayland2023-10-19T05:21:01Z<p>Weng Xuetian: /* Fcitx managed XKB layout */</p>
<hr />
<div>[https://wayland.freedesktop.org/ Wayland] is the next generation of display server protocol. While the initial release of the protocol is in 2008, the support of input method is not really ideal.<br />
<br />
Also, using input method on Wayland-based compositor may require different setup to make it work, and certain features of fcitx that works under X11 are not yet supported by Wayland.<br />
<br />
This page will try to cover all the current information with some underlying details, and [[Special:MyLanguage/Setup Fcitx 5|Setup Fcitx 5]] is still generally useful.<br />
<br />
== Applications ==<br />
=== Legacy X11 application that runs under XWayland ===<br />
In a word, XWayland support for input method is as good as normal X11 display server. As long as you set the same environment variable, using Xwayland should not be a issue. This category includes: <br />
<br />
* Xlib-based (and also other toolkit based on Xlib, e.g. tk, SDL1, etc), e.g. xterm, rxvt. Make sure XMODIFIERS is set correctly.<br />
* Gtk2-based applications, similar to Xlib, but can use fcitx im module. Set GTK_IM_MODULE to fcitx will give it best experience.<br />
* SDL2-based applications that doesn't default to wayland. Set SDL_IM_MODULE to fcitx<br />
* electron, chromium, these are still default to X11, similar to Gtk2 case.<br />
* For Qt4 applcation, Qt 4 can only use X11. You will need to QT_IM_MODULE to fcitx. Same for Qt5+ that uses XCB (can be override with QT_QPA_PLATFORM=xcb).<br />
<br />
=== Gtk3 / Gtk4 ===<br />
Gtk3 and Gtk4 support text-input-v3 natively. At the same time, it's also possible to use fcitx im module under wayland. So, either GTK_IM_MODULE=wayland or GTK_IM_MODULE=fcitx works. There are some difference to it. text-input-v3<br />
<br />
=== Qt5 / Qt6 ===<br />
If your Qt application natively runs under Wayland, you can either unset QT_IM_MODULE to make it use text-input-v2, or set QT_IM_MODULE=fcitx to make it use fcitx im module.<br />
<br />
text-input-v2 is not upstreamed to wayland-protocols, that is probably why only kwin support it. This means in non-kwin environment, you will need to use QT_IM_MODULE=fcitx to make the Qt applications work.<br />
<br />
On Qt6, you may also use QT_IM_MODULE= (empty) or QT_IM_MODULE=wayland if your Qt vesion contains this https://codereview.qt-project.org/c/qt/qtwayland/+/416862.<br />
<br />
=== Native wayland application (winit) ===<br />
Most likely text-input-v3 is being used.<br />
<br />
=== Chromium / Electron ===<br />
{{warning|The information in this section may not be up to date to reflect upstream change, especially the default behavior when no option is changed.}}<br />
TL;DR version, if you use XWayland to run Chromium or Electron application, just install Gtk im module and GTK_IM_MODULE=fcitx the same way like X11.<br />
<br />
If you choose to run it natively under Wayland, for chromium you will need to use<br />
<br />
# If your compositor supports text-input-v1 protocol. Check the compositor section below.<br />
chromium --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime <br />
<br />
Or<br />
<br />
# You will get wrong position for the input method popup window, unless you use GNOME shell + kimpanel extension.<br />
chromium --enable-features=UseOzonePlatform --ozone-platform=wayland --gtk-version=4 <br />
<br />
For electron, only the first option is avaiable (electron does NOT support to run internal chromium with gtk4), e.g. for vscode<br />
<br />
# If your compositor supports text-input-v1 protocol. Check the compositor section below.<br />
code --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime<br />
<br />
By default it should run under Xwayland (As of 2023/02/25 on Archlinux/Chromium 110.0.5481.177), but some user also reports it is using wayland even the "Preferred Ozone Platform" is "Default". So to check whether it's really run with wayland, you can use xeyes or xwininfo. With xeyes, if it's an X11 window, the "eyes" will move with mouse, otherwise it's wayland. With xwininfo, if the mouse cursor changed to "+" shape, and click the window shows the window information, then it is a X11 window.<br />
<br />
You may force it to run with Wayland, or X11 with the flag <code>--ozone-platform=wayland</code> and <code>--ozone-platform=x11</code>. You may persistent this by changing the option "Preferred Ozone Platform" in chrome://flags. It has four values, "Default", "X11", "Wayland", "Auto".<br />
<br />
It's possible to make it use GTK_IM_MODULE if it runs with Gtk4 (only supported by chromium/chrome at this time, not electron) by passing <code>--gtk-version=4</code>.<br />
<br />
It's also possible to make it use text-input-v1 by passing <code>--enable-wayland-ime</code> in addition to the flag above.<br />
<br />
The Chromium support for text-input-v1 is not very stable and you may hit some random crash. E.g. in the past, version 112 has a crash bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1431532 , which is fixed in version 115. In the bug comment, Chromium developer claims this text-input-v1 is only supposed to be used internally and not well supported, so use this at your own risk though it's currently the only out of box option. <br />
<br />
You should only use one of <code>--enable-wayland-ime</code> or <code>--gtk-version=4</code>, depending on you want to use text-input-v1, or gtk4 im module. text-input-v1 works for kwin 5.27 and weston. Gtk4 im module works on all environment, but only GNOME with Kimpanel extension can display the popup window in the correct position.<br />
<br />
== Support in Wayland Compositor ==<br />
<br />
Even if you are using only native wayland applications, Xwayland is recommended to be enabled for following reason. If client side input panel in im module does not work, fcitx will fallback to a X11 window, instead of a wayland window. The reason for this is because wayland window can not be placed freely on the screen. On the contrary, even if im module can only pass a coordinate relative to the application window to fcitx, which make the coordinate position doesn't make much sense, if your application window size is "maximized", the coordinate may just be "right" if treated as the global coordinate. This makes X11 window a better option than a randomly placed wayland window.<br />
<br />
=== KDE Plasma ===<br />
Best setup:<br />
* KDE Plasma 5.27<br />
* Environment variables:<br />
** Set <code>XMODIFIERS=@im=fcitx</code> for XWayland application<br />
** Start fcitx5 by go to "System settings" -> "Virtual keyboard" -> Select Fcitx 5<br />
** Do not set GTK_IM_MODULE & QT_IM_MODULE & SDL_IM_MODULE<br />
** Run chromium/electron application with <code>--enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime</code><br />
* Caveats:<br />
** Certain Gtk/Qt application that only works under X11 may still need to set GTK_IM_MODULE or QT_IM_MODULE for them individually.<br />
** If you set GTK_IM_MODULE/QT_IM_MODULE globally, you will hit this issue [[Special:MyLanguage/FAQ#Candidate_window_is_blinking_under_wayland_with_Fcitx_5|Candidate window is blinking under wayland with Fcitx 5]]<br />
<br />
Support Information:<br />
* App/Compositor supports text-input-v2 and text-input-v3.<br />
* Comopositor/Application uses zwp_input_method_v1. <br />
* 5.27 additionally supports text-input-v1.<br />
* 5.24 usable zwp_input_method_v1 with fcitx5. Pre-5.24 there are lots of problems, always use fcitx im module instead.<br />
* Use "Virtual keyboard" KCM to launch fcitx5. This is required to use text-input protocol. If you launch fcitx this way, make sure you do not use "restart" in the tray menu, since the socket passed from KWin can not be reused with the newly restarted fcitx.<br />
<br />
=== GNOME ===<br />
Best setup:<br />
* Environment variables:<br />
** Set <code>XMODIFIERS=@im=fcitx</code> for XWayland application<br />
** Set <code>QT_IM_MODULE=fcitx</code> for Qt, since Qt5 would use XWayland by default.<br />
** Run chrome with XWayland and <code>GTK_IM_MODULE=fcitx</code><br />
<br />
Support information:<br />
* Application/Compositor uses text-input-v3<br />
* Compositor/Input Method uses ibus dbus protocol, so ibus frontend is required to be used.<br />
* Adding Fcitx 5 to autostart, it will replace any existing ibus-daemon upon start up so it will work out of box.<br />
* Popup candidate window is not able to be displayed over gnome-shell UI. Only solution is to use [[Special:MyLanguage/Kimpanel|Kimpanel]], [https://extensions.gnome.org/extension/261/kimpanel/ link to extension].<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Sway ===<br />
* Application/Compositor uses text-input-v3<br />
* Comopositor/Application uses zwp_input_method_v2, but it's partially implemented. You will need [https://github.com/swaywm/sway/pull/7226 this pull request] to make it show the popup candidate window for text-input-v3 client.<br />
* fcitx im module also works.<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Weston ===<br />
* Application/Compositor uses text-input-v1<br />
* Comopositor/Application uses zwp_input_method_v1.<br />
* Since it has no text-input-v3, which is more commonly used, im module is the only solution for Gtk/Qt, need to set GTK_IM_MODULE=fcitx and QT_IM_MODULE=fcitx.<br />
* Add following content to ~/.config/weston.ini to make it launch fcitx 5. (xwayland part is recommended to make fcitx work best, even if it's wayland)<br />
<br />
<pre><br />
[core]<br />
xwayland=true<br />
<br />
[input-method]<br />
path=/usr/bin/fcitx5<br />
</pre><br />
<br />
=== Other compositors ===<br />
Please check their upstream for more information. For wlroots based compositors, it is possible that they also support in the same way as Sway does, or zwp_input_method could also be unsupported.<br />
<br />
== Known Issues ==<br />
=== Fcitx managed XKB layout ===<br />
Unlike X11, there is no generic way to set XKB layout to compositor, which means it can only be implemented for every individual desktop. Right now, Fcitx managed layout only works for KDE Plasma and GNOME.<br />
<br />
As for other desktop, in order to make this "semi" work you'll need to ensure following:<br />
<br />
* The XKB layout of the input method group should be the same as the actual xkb layout you configured for the compositor. Fcitx will "think" the layout is the same and bypass the key conversion logic.<br />
* If you need other layout for text typing (e.g. Arabic), just add them to the Fcitx. As long as the key is forwarded to fcitx, it should work.<br />
<br />
=== Popup candidate window ===<br />
Wayland does not have a global coordinate system for regular client, so for native wayland client, it is impossible for Fcitx to place a wayland surface at a certain position. In order for popup window to be placed at the correct position, there are following cases:<br />
* Xwayland have no problem and it should work as good as X11.<br />
* If zwp_input_method protocol can be used, it has a surface role to allow compositor to place the popup window for input method. This only works if client uses text-input protocol.<br />
* For GNOME, kimpanel extension can read window coordinate since it's running inside compositor. As long as im module can report relative coordinate, kimpanel extension can display the popup window at the correct position. As similar approach for Plasma kimpanel is planned, but not yet implemented.<br />
* For Gtk/Qt, fcitx's im module implement a way to render the popup with in the client process. This has some limitation because implemenation of xdg_popup in Gtk3/Qt5 doesn't support reposition the window. So show/hide trick is used to mitigate this, but it may cause window blinking. Fcitx tries not to move window if possible. You may also disable popup animation if you're using KWin to help reduce the blinking.<br />
<br />
=== Per-window input method state ===<br />
When zwp_input_method is used, essentially there is only one input context visible to fcitx, and fcitx cannot distinguish what application is being used. Which means the input method "active"/"inactivate" state is now "global".<br />
<br />
There is planned change to obtain the active application name and use "virtual" input context for wayland frontend. It's not yet in the stable version of Fcitx.</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Using_Fcitx_5_on_Wayland&diff=45873Using Fcitx 5 on Wayland2023-10-19T05:19:47Z<p>Weng Xuetian: /* Fcitx managed XKB layout */</p>
<hr />
<div>[https://wayland.freedesktop.org/ Wayland] is the next generation of display server protocol. While the initial release of the protocol is in 2008, the support of input method is not really ideal.<br />
<br />
Also, using input method on Wayland-based compositor may require different setup to make it work, and certain features of fcitx that works under X11 are not yet supported by Wayland.<br />
<br />
This page will try to cover all the current information with some underlying details, and [[Special:MyLanguage/Setup Fcitx 5|Setup Fcitx 5]] is still generally useful.<br />
<br />
== Applications ==<br />
=== Legacy X11 application that runs under XWayland ===<br />
In a word, XWayland support for input method is as good as normal X11 display server. As long as you set the same environment variable, using Xwayland should not be a issue. This category includes: <br />
<br />
* Xlib-based (and also other toolkit based on Xlib, e.g. tk, SDL1, etc), e.g. xterm, rxvt. Make sure XMODIFIERS is set correctly.<br />
* Gtk2-based applications, similar to Xlib, but can use fcitx im module. Set GTK_IM_MODULE to fcitx will give it best experience.<br />
* SDL2-based applications that doesn't default to wayland. Set SDL_IM_MODULE to fcitx<br />
* electron, chromium, these are still default to X11, similar to Gtk2 case.<br />
* For Qt4 applcation, Qt 4 can only use X11. You will need to QT_IM_MODULE to fcitx. Same for Qt5+ that uses XCB (can be override with QT_QPA_PLATFORM=xcb).<br />
<br />
=== Gtk3 / Gtk4 ===<br />
Gtk3 and Gtk4 support text-input-v3 natively. At the same time, it's also possible to use fcitx im module under wayland. So, either GTK_IM_MODULE=wayland or GTK_IM_MODULE=fcitx works. There are some difference to it. text-input-v3<br />
<br />
=== Qt5 / Qt6 ===<br />
If your Qt application natively runs under Wayland, you can either unset QT_IM_MODULE to make it use text-input-v2, or set QT_IM_MODULE=fcitx to make it use fcitx im module.<br />
<br />
text-input-v2 is not upstreamed to wayland-protocols, that is probably why only kwin support it. This means in non-kwin environment, you will need to use QT_IM_MODULE=fcitx to make the Qt applications work.<br />
<br />
On Qt6, you may also use QT_IM_MODULE= (empty) or QT_IM_MODULE=wayland if your Qt vesion contains this https://codereview.qt-project.org/c/qt/qtwayland/+/416862.<br />
<br />
=== Native wayland application (winit) ===<br />
Most likely text-input-v3 is being used.<br />
<br />
=== Chromium / Electron ===<br />
{{warning|The information in this section may not be up to date to reflect upstream change, especially the default behavior when no option is changed.}}<br />
TL;DR version, if you use XWayland to run Chromium or Electron application, just install Gtk im module and GTK_IM_MODULE=fcitx the same way like X11.<br />
<br />
If you choose to run it natively under Wayland, for chromium you will need to use<br />
<br />
# If your compositor supports text-input-v1 protocol. Check the compositor section below.<br />
chromium --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime <br />
<br />
Or<br />
<br />
# You will get wrong position for the input method popup window, unless you use GNOME shell + kimpanel extension.<br />
chromium --enable-features=UseOzonePlatform --ozone-platform=wayland --gtk-version=4 <br />
<br />
For electron, only the first option is avaiable (electron does NOT support to run internal chromium with gtk4), e.g. for vscode<br />
<br />
# If your compositor supports text-input-v1 protocol. Check the compositor section below.<br />
code --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime<br />
<br />
By default it should run under Xwayland (As of 2023/02/25 on Archlinux/Chromium 110.0.5481.177), but some user also reports it is using wayland even the "Preferred Ozone Platform" is "Default". So to check whether it's really run with wayland, you can use xeyes or xwininfo. With xeyes, if it's an X11 window, the "eyes" will move with mouse, otherwise it's wayland. With xwininfo, if the mouse cursor changed to "+" shape, and click the window shows the window information, then it is a X11 window.<br />
<br />
You may force it to run with Wayland, or X11 with the flag <code>--ozone-platform=wayland</code> and <code>--ozone-platform=x11</code>. You may persistent this by changing the option "Preferred Ozone Platform" in chrome://flags. It has four values, "Default", "X11", "Wayland", "Auto".<br />
<br />
It's possible to make it use GTK_IM_MODULE if it runs with Gtk4 (only supported by chromium/chrome at this time, not electron) by passing <code>--gtk-version=4</code>.<br />
<br />
It's also possible to make it use text-input-v1 by passing <code>--enable-wayland-ime</code> in addition to the flag above.<br />
<br />
The Chromium support for text-input-v1 is not very stable and you may hit some random crash. E.g. in the past, version 112 has a crash bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1431532 , which is fixed in version 115. In the bug comment, Chromium developer claims this text-input-v1 is only supposed to be used internally and not well supported, so use this at your own risk though it's currently the only out of box option. <br />
<br />
You should only use one of <code>--enable-wayland-ime</code> or <code>--gtk-version=4</code>, depending on you want to use text-input-v1, or gtk4 im module. text-input-v1 works for kwin 5.27 and weston. Gtk4 im module works on all environment, but only GNOME with Kimpanel extension can display the popup window in the correct position.<br />
<br />
== Support in Wayland Compositor ==<br />
<br />
Even if you are using only native wayland applications, Xwayland is recommended to be enabled for following reason. If client side input panel in im module does not work, fcitx will fallback to a X11 window, instead of a wayland window. The reason for this is because wayland window can not be placed freely on the screen. On the contrary, even if im module can only pass a coordinate relative to the application window to fcitx, which make the coordinate position doesn't make much sense, if your application window size is "maximized", the coordinate may just be "right" if treated as the global coordinate. This makes X11 window a better option than a randomly placed wayland window.<br />
<br />
=== KDE Plasma ===<br />
Best setup:<br />
* KDE Plasma 5.27<br />
* Environment variables:<br />
** Set <code>XMODIFIERS=@im=fcitx</code> for XWayland application<br />
** Start fcitx5 by go to "System settings" -> "Virtual keyboard" -> Select Fcitx 5<br />
** Do not set GTK_IM_MODULE & QT_IM_MODULE & SDL_IM_MODULE<br />
** Run chromium/electron application with <code>--enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime</code><br />
* Caveats:<br />
** Certain Gtk/Qt application that only works under X11 may still need to set GTK_IM_MODULE or QT_IM_MODULE for them individually.<br />
** If you set GTK_IM_MODULE/QT_IM_MODULE globally, you will hit this issue [[Special:MyLanguage/FAQ#Candidate_window_is_blinking_under_wayland_with_Fcitx_5|Candidate window is blinking under wayland with Fcitx 5]]<br />
<br />
Support Information:<br />
* App/Compositor supports text-input-v2 and text-input-v3.<br />
* Comopositor/Application uses zwp_input_method_v1. <br />
* 5.27 additionally supports text-input-v1.<br />
* 5.24 usable zwp_input_method_v1 with fcitx5. Pre-5.24 there are lots of problems, always use fcitx im module instead.<br />
* Use "Virtual keyboard" KCM to launch fcitx5. This is required to use text-input protocol. If you launch fcitx this way, make sure you do not use "restart" in the tray menu, since the socket passed from KWin can not be reused with the newly restarted fcitx.<br />
<br />
=== GNOME ===<br />
Best setup:<br />
* Environment variables:<br />
** Set <code>XMODIFIERS=@im=fcitx</code> for XWayland application<br />
** Set <code>QT_IM_MODULE=fcitx</code> for Qt, since Qt5 would use XWayland by default.<br />
** Run chrome with XWayland and <code>GTK_IM_MODULE=fcitx</code><br />
<br />
Support information:<br />
* Application/Compositor uses text-input-v3<br />
* Compositor/Input Method uses ibus dbus protocol, so ibus frontend is required to be used.<br />
* Adding Fcitx 5 to autostart, it will replace any existing ibus-daemon upon start up so it will work out of box.<br />
* Popup candidate window is not able to be displayed over gnome-shell UI. Only solution is to use [[Special:MyLanguage/Kimpanel|Kimpanel]], [https://extensions.gnome.org/extension/261/kimpanel/ link to extension].<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Sway ===<br />
* Application/Compositor uses text-input-v3<br />
* Comopositor/Application uses zwp_input_method_v2, but it's partially implemented. You will need [https://github.com/swaywm/sway/pull/7226 this pull request] to make it show the popup candidate window for text-input-v3 client.<br />
* fcitx im module also works.<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Weston ===<br />
* Application/Compositor uses text-input-v1<br />
* Comopositor/Application uses zwp_input_method_v1.<br />
* Since it has no text-input-v3, which is more commonly used, im module is the only solution for Gtk/Qt, need to set GTK_IM_MODULE=fcitx and QT_IM_MODULE=fcitx.<br />
* Add following content to ~/.config/weston.ini to make it launch fcitx 5. (xwayland part is recommended to make fcitx work best, even if it's wayland)<br />
<br />
<pre><br />
[core]<br />
xwayland=true<br />
<br />
[input-method]<br />
path=/usr/bin/fcitx5<br />
</pre><br />
<br />
=== Other compositors ===<br />
Please check their upstream for more information. For wlroots based compositors, it is possible that they also support in the same way as Sway does, or zwp_input_method could also be unsupported.<br />
<br />
== Known Issues ==<br />
=== Fcitx managed XKB layout ===<br />
Unlike X11, there is no generic way to set XKB layout to compositor, which means it can only be implemented for every individual desktop. Right now, Fcitx managed layout only works for KDE Plasma and GNOME.<br />
<br />
As for other desktop, in order to make this "semi" work you'll need to ensure following:<br />
<br />
* The system layout in the group should be the same as the actual xkb layout you configured for the compositor.<br />
* Configure only one layout.<br />
* If you need other layout for text typing (e.g. Arabic), just add them to the Fcitx. As long as the key is forwarded to fcitx, it should work.<br />
<br />
=== Popup candidate window ===<br />
Wayland does not have a global coordinate system for regular client, so for native wayland client, it is impossible for Fcitx to place a wayland surface at a certain position. In order for popup window to be placed at the correct position, there are following cases:<br />
* Xwayland have no problem and it should work as good as X11.<br />
* If zwp_input_method protocol can be used, it has a surface role to allow compositor to place the popup window for input method. This only works if client uses text-input protocol.<br />
* For GNOME, kimpanel extension can read window coordinate since it's running inside compositor. As long as im module can report relative coordinate, kimpanel extension can display the popup window at the correct position. As similar approach for Plasma kimpanel is planned, but not yet implemented.<br />
* For Gtk/Qt, fcitx's im module implement a way to render the popup with in the client process. This has some limitation because implemenation of xdg_popup in Gtk3/Qt5 doesn't support reposition the window. So show/hide trick is used to mitigate this, but it may cause window blinking. Fcitx tries not to move window if possible. You may also disable popup animation if you're using KWin to help reduce the blinking.<br />
<br />
=== Per-window input method state ===<br />
When zwp_input_method is used, essentially there is only one input context visible to fcitx, and fcitx cannot distinguish what application is being used. Which means the input method "active"/"inactivate" state is now "global".<br />
<br />
There is planned change to obtain the active application name and use "virtual" input context for wayland frontend. It's not yet in the stable version of Fcitx.</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Setup_Fcitx_5&diff=45799Setup Fcitx 52023-10-06T18:34:56Z<p>Weng Xuetian: </p>
<hr />
<div><languages /><br />
<translate><br />
= Autostart =<br />
<br />
== Distribution specific tool ==<br />
<br />
Distribution may provides some specific tool for autostart Fcitx and usually also set up environment variable together.<br />
<br />
=== im-config (Debian/Debian-based/Ubuntu) ===<br />
This is a tool used by debian or debian based distribution. Just run <code>im-config</code> from command line after login to your graphics interface and it should pop up a wizard, just select fcitx5 from it.<br />
<br />
=== imsettings (Fedora) ===<br />
A program that is similar to im-config, and it also provides a GUI to select the input method framework to be used. Under default installation, imsettings should be installed by default, if not, you may install that. imsettings can setup the environment variable and also launch the input method correspondingly. It also provides a graphical frontend [https://pkgs.org/search/?q=im-chooser im-chooser] to change the configuration. What you need to do is simply execute <code>im-chooser</code>, log-out and log-in again.<br />
<br />
[https://www.youtube.com/watch?v=FwqTtGEN4vQ Video instruction for Fedora 36 KDE]. This instruction should work for other non-GNOME XDG-compliance desktop.<br />
<br />
=== fcitx5-autostart (Fedora) ===<br />
This is a [https://pkgs.org/search/?q=fcitx5-autostart fedora package] that bundles a /etc/profile.d script for setting up environment variables and also XDG autostart file for autostart.<br />
<br />
== XDG Autostart ==<br />
<br />
Certain distribution may not provide such a file. If not, you can simply copy <code>/usr/share/applications/org.fcitx.Fcitx5.desktop</code> to <code>~/.config/autostart</code><br />
<br />
<nowiki>mkdir -p ~/.config/autostart && cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart</nowiki><br />
<br />
== KWin Wayland 5.24+ ==<br />
You do not have to do this if you use only Gtk/Qt/Xwayland application. If you want to use wayland native applications supporting text-input-v3, you will need to let KWin start input method as a special client.<br />
<br />
Simply open systemsettings, go to the "Virtual Keyboard" section, change the input method from "None" to "Fcitx 5".<br />
<br />
== Non-XDG compliant Window Manager/Wayland Compoistor ==<br />
<br />
In those case may not support XDG Autostart, please check your Window Manager manual about how to automatically launch a program upon start.<br />
<br />
=== Weston ===<br />
Weston is a reference wayland compositor implementation, which is not a common setup for normal user.<br />
<br />
If you want to use the westons zwp_input_method_v1 implementation, you will need to have following content in your ~/.config/weston.ini (Update the path accordingly for if it is not /usr/bin/fcitx5).<br />
<br />
<nowiki>[input-method]<br />
path=/usr/bin/fcitx5</nowiki><br />
<br />
There are certain issues if you try to use weston in a nested mode for debugging and fcitx5, if you already have a running fcitx5 in the same session.<br />
<br />
If you just run weston under X11 for debugging purpose, easiest way is to simply quit fcitx5 before start weston.<br />
<br />
Also be aware, there is a bug that weston does not set DISPLAY correctly input method on the first run. You may need to kill fcitx5 once to make it get the right DISPLAY or use OpenX11Connection dbus call to let fcitx to connect.<br />
<br />
= Environment variables =<br />
<br />
Due to the transition phase in a lot of different places, there is no perfect solution that works for every one. Please choose your own solution based on your environment. Basically what you want to do is to set following environment variables for your desktop session. <br />
<nowiki><br />
XMODIFIERS=@im=fcitx<br />
GTK_IM_MODULE=fcitx<br />
QT_IM_MODULE=fcitx</nowiki><br />
Though it looks like valid shell script, please *NOTE* that the snippet above is just to demonstrate what these value gonna be. Please check the section below for concrete syntax for different methods.<br />
<br />
== Login shell profile ==<br />
If you are using Bash as your login shell, <code>~/.bash_profile</code> is the best user-level thing you can rely on. It is widely supported by different DMs and will also work if you start graphics from TTY.<br />
<br />
* Supported by mainstream Display manager, including GDM/SDDM/LightDM<br />
* TTY login<br />
<br />
If you are not using bash, you may want to double check if your shell profile can be used as a place to set environment variables, especially you are using some uncommon login shells. <br />
<br />
The snippet that you need to add to <code>~/.bash_profile</code> would be<br />
<nowiki><br />
export XMODIFIERS=@im=fcitx<br />
export GTK_IM_MODULE=fcitx<br />
export QT_IM_MODULE=fcitx</nowiki><br />
<br />
Some may argue that <code>~/.profile</code> is a shell agnostic solution, which is wrong. While GDM always source this file, SDDM/Bash would not source this file if <code>~/.bash_profile</code> presents. This makes <code>~/.bash_profile</code> a better solution because bash is quite widely used. But check your login shell before proceeding, some distribution may not use bash as default shell.<br />
<br />
Here is an [https://youtu.be/8XDmLr6wb4M video] on how to manual setup environment variable on Archlinux<br />
<br />
== /etc/profile ==<br />
Best option if you does not care about modifying a file with root. This file is generally supported by all distribution. The code snippet that you need to append to the end of <code>/etc/profile</code> is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].<br />
<br />
== ~/.xprofile ==<br />
An old perfect option if you are using X11 and display manager. But there is no counterpart for Wayland, so it is not ideal if you want to set environment variable for Wayland. The code that you want to add is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].<br />
<br />
== environment.d ==<br />
This is a new configuration that introduced by system.d, but not widely used supported by desktop environment or display manager. It is basically the environment configuration for systemd user unit. Currently, it is only supported by GDM or Plasma 5.22+. As GDM, it means any session that login with GDM will work. As for Plasma, it means it works for Plasma regardless what DM you are using.<br />
<br />
This configuration is applied upon your first user session login and persist afterwards unless you manually stop the systemd user. So after you modifies this configuration, the easiest way to make it effective is to reboot your system.<br />
<br />
The syntax is similar to shell, but no <code>export</code> is required. For example, you can create a file <code>~/.config/environment.d/im.conf</code> with following content:<br />
<nowiki><br />
XMODIFIERS=@im=fcitx<br />
GTK_IM_MODULE=fcitx<br />
QT_IM_MODULE=fcitx</nowiki><br />
<br />
== pam_env.so ==<br />
This is an obsolete solution for following reasons:<br />
* pam deprecate user level configuration <code>~/.pam_environment</code> since 1.5.0.<br />
* Some distribution does not enable pam_env in their pam configuration.<br />
<br />
If you know it works for your system, you can put following snippet to your <code>~/.pam_environment</code>.<br />
<nowiki>XMODIFIERS DEFAULT=\@im=fcitx<br />
GTK_IM_MODULE DEFAULT=fcitx<br />
QT_IM_MODULE DEFAULT=fcitx</nowiki>.<br />
<br />
Please '''NOTE''' that the syntax is different from shell script.<br />
<br />
== ~/.config/plasma-workspace/env/*.sh ==<br />
A env script location that only works for Plasma desktop, you need to create your own .sh file, e.g. <code>~/.config/plasma-workspace/env/im.sh</code> and put the code snippet same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].<br />
<br />
== Other less common setup ==<br />
There are some other variable that might be useful certain applications.<br />
=== SDL_IM_MODULE ===<br />
Set the value to fcitx. Only SDL2 requires this. SDL1 uses XIM.<br />
=== GLFW_IM_MODULE ===<br />
This is a variable only used by [https://github.com/kovidgoyal/kitty/ kitty]. You need to set it to `GLFW_IM_MODULE=ibus`.<br />
=== Binary Qt application ===<br />
Due to Qt 5 does not support XIM, and it only bundles ibus im module, you may want to set `QT_IM_MODULE=ibus` for Qt application that does not use your system Qt library. (It may still not work because certain Qt application does not even bundle any im module). <br />
<br />
= DBus =<br />
On most distribution that ships with systemd, this should no longer be an issue. But if you are using some so called "systemd" free distribution, you may need to start DBus yourself and set the relevant environment variables. Usually, this can be done by adding a line in like this in your start up script. E.g. ~/.xprofile if you are using X11. Also you need to make sure this syntax works for your login shell. <br />
<br />
<nowiki>eval `dbus-launch --sh-syntax --exit-with-session`</nowiki><br />
<br />
= Configure Fcitx 5 =<br />
<br />
See [[Special:myLanguage/Configtool (Fcitx 5)|Configtool (Fcitx 5)]].<br />
<br />
</translate></div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Using_Fcitx_5_on_Wayland&diff=45798Using Fcitx 5 on Wayland2023-07-29T17:19:16Z<p>Weng Xuetian: </p>
<hr />
<div>[https://wayland.freedesktop.org/ Wayland] is the next generation of display server protocol. While the initial release of the protocol is in 2008, the support of input method is not really ideal.<br />
<br />
Also, using input method on Wayland-based compositor may require different setup to make it work, and certain features of fcitx that works under X11 are not yet supported by Wayland.<br />
<br />
This page will try to cover all the current information with some underlying details, and [[Special:MyLanguage/Setup Fcitx 5|Setup Fcitx 5]] is still generally useful.<br />
<br />
== Applications ==<br />
=== Legacy X11 application that runs under XWayland ===<br />
In a word, XWayland support for input method is as good as normal X11 display server. As long as you set the same environment variable, using Xwayland should not be a issue. This category includes: <br />
<br />
* Xlib-based (and also other toolkit based on Xlib, e.g. tk, SDL1, etc), e.g. xterm, rxvt. Make sure XMODIFIERS is set correctly.<br />
* Gtk2-based applications, similar to Xlib, but can use fcitx im module. Set GTK_IM_MODULE to fcitx will give it best experience.<br />
* SDL2-based applications that doesn't default to wayland. Set SDL_IM_MODULE to fcitx<br />
* electron, chromium, these are still default to X11, similar to Gtk2 case.<br />
* For Qt4 applcation, Qt 4 can only use X11. You will need to QT_IM_MODULE to fcitx. Same for Qt5+ that uses XCB (can be override with QT_QPA_PLATFORM=xcb).<br />
<br />
=== Gtk3 / Gtk4 ===<br />
Gtk3 and Gtk4 support text-input-v3 natively. At the same time, it's also possible to use fcitx im module under wayland. So, either GTK_IM_MODULE=wayland or GTK_IM_MODULE=fcitx works. There are some difference to it. text-input-v3<br />
<br />
=== Qt5 / Qt6 ===<br />
If your Qt application natively runs under Wayland, you can either unset QT_IM_MODULE to make it use text-input-v2, or set QT_IM_MODULE=fcitx to make it use fcitx im module.<br />
<br />
text-input-v2 is not upstreamed to wayland-protocols, that is probably why only kwin support it. This means in non-kwin environment, you will need to use QT_IM_MODULE=fcitx to make the Qt applications work.<br />
<br />
On Qt6, you may also use QT_IM_MODULE= (empty) or QT_IM_MODULE=wayland if your Qt vesion contains this https://codereview.qt-project.org/c/qt/qtwayland/+/416862.<br />
<br />
=== Native wayland application (winit) ===<br />
Most likely text-input-v3 is being used.<br />
<br />
=== Chromium / Electron ===<br />
{{warning|The information in this section may not be up to date to reflect upstream change, especially the default behavior when no option is changed.}}<br />
TL;DR version, if you use XWayland to run Chromium or Electron application, just install Gtk im module and GTK_IM_MODULE=fcitx the same way like X11.<br />
<br />
If you choose to run it natively under Wayland, for chromium you will need to use<br />
<br />
# If your compositor supports text-input-v1 protocol. Check the compositor section below.<br />
chromium --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime <br />
<br />
Or<br />
<br />
# You will get wrong position for the input method popup window, unless you use GNOME shell + kimpanel extension.<br />
chromium --enable-features=UseOzonePlatform --ozone-platform=wayland --gtk-version=4 <br />
<br />
For electron, only the first option is avaiable (electron does NOT support to run internal chromium with gtk4), e.g. for vscode<br />
<br />
# If your compositor supports text-input-v1 protocol. Check the compositor section below.<br />
code --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime<br />
<br />
By default it should run under Xwayland (As of 2023/02/25 on Archlinux/Chromium 110.0.5481.177), but some user also reports it is using wayland even the "Preferred Ozone Platform" is "Default". So to check whether it's really run with wayland, you can use xeyes or xwininfo. With xeyes, if it's an X11 window, the "eyes" will move with mouse, otherwise it's wayland. With xwininfo, if the mouse cursor changed to "+" shape, and click the window shows the window information, then it is a X11 window.<br />
<br />
You may force it to run with Wayland, or X11 with the flag <code>--ozone-platform=wayland</code> and <code>--ozone-platform=x11</code>. You may persistent this by changing the option "Preferred Ozone Platform" in chrome://flags. It has four values, "Default", "X11", "Wayland", "Auto".<br />
<br />
It's possible to make it use GTK_IM_MODULE if it runs with Gtk4 (only supported by chromium/chrome at this time, not electron) by passing <code>--gtk-version=4</code>.<br />
<br />
It's also possible to make it use text-input-v1 by passing <code>--enable-wayland-ime</code> in addition to the flag above.<br />
<br />
The Chromium support for text-input-v1 is not very stable and you may hit some random crash. E.g. in the past, version 112 has a crash bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1431532 , which is fixed in version 115. In the bug comment, Chromium developer claims this text-input-v1 is only supposed to be used internally and not well supported, so use this at your own risk though it's currently the only out of box option. <br />
<br />
You should only use one of <code>--enable-wayland-ime</code> or <code>--gtk-version=4</code>, depending on you want to use text-input-v1, or gtk4 im module. text-input-v1 works for kwin 5.27 and weston. Gtk4 im module works on all environment, but only GNOME with Kimpanel extension can display the popup window in the correct position.<br />
<br />
== Support in Wayland Compositor ==<br />
<br />
Even if you are using only native wayland applications, Xwayland is recommended to be enabled for following reason. If client side input panel in im module does not work, fcitx will fallback to a X11 window, instead of a wayland window. The reason for this is because wayland window can not be placed freely on the screen. On the contrary, even if im module can only pass a coordinate relative to the application window to fcitx, which make the coordinate position doesn't make much sense, if your application window size is "maximized", the coordinate may just be "right" if treated as the global coordinate. This makes X11 window a better option than a randomly placed wayland window.<br />
<br />
=== KDE Plasma ===<br />
Best setup:<br />
* KDE Plasma 5.27<br />
* Environment variables:<br />
** Set <code>XMODIFIERS=@im=fcitx</code> for XWayland application<br />
** Start fcitx5 by go to "System settings" -> "Virtual keyboard" -> Select Fcitx 5<br />
** Do not set GTK_IM_MODULE & QT_IM_MODULE & SDL_IM_MODULE<br />
** Run chromium/electron application with <code>--enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime</code><br />
* Caveats:<br />
** Certain Gtk/Qt application that only works under X11 may still need to set GTK_IM_MODULE or QT_IM_MODULE for them individually.<br />
** If you set GTK_IM_MODULE/QT_IM_MODULE globally, you will hit this issue [[Special:MyLanguage/FAQ#Candidate_window_is_blinking_under_wayland_with_Fcitx_5|Candidate window is blinking under wayland with Fcitx 5]]<br />
<br />
Support Information:<br />
* App/Compositor supports text-input-v2 and text-input-v3.<br />
* Comopositor/Application uses zwp_input_method_v1. <br />
* 5.27 additionally supports text-input-v1.<br />
* 5.24 usable zwp_input_method_v1 with fcitx5. Pre-5.24 there are lots of problems, always use fcitx im module instead.<br />
* Use "Virtual keyboard" KCM to launch fcitx5. This is required to use text-input protocol. If you launch fcitx this way, make sure you do not use "restart" in the tray menu, since the socket passed from KWin can not be reused with the newly restarted fcitx.<br />
<br />
=== GNOME ===<br />
Best setup:<br />
* Environment variables:<br />
** Set <code>XMODIFIERS=@im=fcitx</code> for XWayland application<br />
** Set <code>QT_IM_MODULE=fcitx</code> for Qt, since Qt5 would use XWayland by default.<br />
** Run chrome with XWayland and <code>GTK_IM_MODULE=fcitx</code><br />
<br />
Support information:<br />
* Application/Compositor uses text-input-v3<br />
* Compositor/Input Method uses ibus dbus protocol, so ibus frontend is required to be used.<br />
* Adding Fcitx 5 to autostart, it will replace any existing ibus-daemon upon start up so it will work out of box.<br />
* Popup candidate window is not able to be displayed over gnome-shell UI. Only solution is to use [[Special:MyLanguage/Kimpanel|Kimpanel]], [https://extensions.gnome.org/extension/261/kimpanel/ link to extension].<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Sway ===<br />
* Application/Compositor uses text-input-v3<br />
* Comopositor/Application uses zwp_input_method_v2, but it's partially implemented. You will need [https://github.com/swaywm/sway/pull/7226 this pull request] to make it show the popup candidate window for text-input-v3 client.<br />
* fcitx im module also works.<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Weston ===<br />
* Application/Compositor uses text-input-v1<br />
* Comopositor/Application uses zwp_input_method_v1.<br />
* Since it has no text-input-v3, which is more commonly used, im module is the only solution for Gtk/Qt, need to set GTK_IM_MODULE=fcitx and QT_IM_MODULE=fcitx.<br />
* Add following content to ~/.config/weston.ini to make it launch fcitx 5. (xwayland part is recommended to make fcitx work best, even if it's wayland)<br />
<br />
<pre><br />
[core]<br />
xwayland=true<br />
<br />
[input-method]<br />
path=/usr/bin/fcitx5<br />
</pre><br />
<br />
=== Other compositors ===<br />
Please check their upstream for more information. For wlroots based compositors, it is possible that they also support in the same way as Sway does, or zwp_input_method could also be unsupported.<br />
<br />
== Known Issues ==<br />
=== Fcitx managed XKB layout ===<br />
Unlike X11, there is no generic way to set XKB layout to compositor, which means it can only be implemented for every individual desktop. Right now, Fcitx managed layout only works for KDE Plasma.<br />
<br />
As for non-KDE desktop, in order to make this "semi" work you'll need to ensure following:<br />
<br />
* The system layout in the group should be the same as the actual xkb layout you configured for the compositor.<br />
* Configure only one layout.<br />
* If you need other layout for text typing (e.g. Arabic), just add them to the Fcitx. As long as the key is forwarded to fcitx, it should work.<br />
<br />
=== Popup candidate window ===<br />
Wayland does not have a global coordinate system for regular client, so for native wayland client, it is impossible for Fcitx to place a wayland surface at a certain position. In order for popup window to be placed at the correct position, there are following cases:<br />
* Xwayland have no problem and it should work as good as X11.<br />
* If zwp_input_method protocol can be used, it has a surface role to allow compositor to place the popup window for input method. This only works if client uses text-input protocol.<br />
* For GNOME, kimpanel extension can read window coordinate since it's running inside compositor. As long as im module can report relative coordinate, kimpanel extension can display the popup window at the correct position. As similar approach for Plasma kimpanel is planned, but not yet implemented.<br />
* For Gtk/Qt, fcitx's im module implement a way to render the popup with in the client process. This has some limitation because implemenation of xdg_popup in Gtk3/Qt5 doesn't support reposition the window. So show/hide trick is used to mitigate this, but it may cause window blinking. Fcitx tries not to move window if possible. You may also disable popup animation if you're using KWin to help reduce the blinking.<br />
<br />
=== Per-window input method state ===<br />
When zwp_input_method is used, essentially there is only one input context visible to fcitx, and fcitx cannot distinguish what application is being used. Which means the input method "active"/"inactivate" state is now "global".<br />
<br />
There is planned change to obtain the active application name and use "virtual" input context for wayland frontend. It's not yet in the stable version of Fcitx.</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=DBus_Interface&diff=45797DBus Interface2023-07-28T00:20:07Z<p>Weng Xuetian: Created page with "This page is about certain things that you can do with the dbus interface of Fcitx 5. This page will use qdbus as an command example for its simplicity. You may also use dbus..."</p>
<hr />
<div>This page is about certain things that you can do with the dbus interface of Fcitx 5.<br />
<br />
This page will use qdbus as an command example for its simplicity. You may also use dbus-send, or busctl, but the command will be slighty different. Certain functionality is also provided by fcitx5-remote. In that case fcitx5-remote command will also be listed.<br />
<br />
<pre><br />
qdbus [service name] [object path] [interface].[member] [arguments]<br />
busctl --user call [service name] [object path] [interface] [member] [arguments]<br />
dbus-send --session --print-reply --dest=[service name] [object path] [interface].[member] [arguments]<br />
</pre><br />
<br />
For example:<br />
<br />
Call org.fcitx.Fcitx.Controller1.ReloadConfig with argument "pinyin" with these 3 commands would be:<br />
<br />
<pre><br />
qdbus org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.ReloadAddonConfig pinyin<br />
busctl --user call org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1 ReloadAddonConfig s pinyin<br />
dbus-send --session --print-reply --dest=org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.ReloadAddonConfig string:pinyin<br />
</pre><br />
<br />
= Get current input method name =<br />
<pre><br />
qdbus org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.CurrentInputMethod<br />
fcitx5-remote -n<br />
</pre><br />
<br />
= Get current input method group name =<br />
<pre><br />
qdbus org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.CurrentInputMethodGroup<br />
fcitx5-remote -q<br />
</pre><br />
<br />
= Toggle active/inactive state =<br />
<pre><br />
qdbus org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.Toggle<br />
fcitx5-remote -t<br />
</pre><br />
<br />
= Set state to active =<br />
<pre><br />
qdbus org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.Activate<br />
fcitx5-remote -o<br />
</pre><br />
<br />
= Set state to inactive =<br />
<pre><br />
qdbus org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.Deactivate<br />
fcitx5-remote -c<br />
</pre><br />
<br />
= Get current state =<br />
<pre><br />
qdbus org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.State<br />
fcitx5-remote<br />
</pre><br />
<br />
= Ask fcitx to quit =<br />
<pre><br />
# Simply "killall fcitx5" is also fine.<br />
qdbus org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.Exit<br />
fcitx5-remote -e<br />
</pre><br />
<br />
= Reload configuration from disk =<br />
<pre><br />
qdbus org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.ReloadAddonConfig [addon name]<br />
qdbus org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.ReloadConfig # reload global config<br />
</pre><br />
<br />
= Open a new X11 connection from Fcitx =<br />
<pre><br />
qdbus org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.OpenX11Connection [x11 display] <br />
</pre><br />
<br />
= Open a new wayland connection from Fcitx =<br />
<pre><br />
qdbus org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.OpenWaylandConnection [wayland display]<br />
</pre><br />
<br />
= Set current input method =<br />
<pre><br />
qdbus org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.SetCurrentIM [input method name]<br />
fcitx5-remote -s [input method name]<br />
</pre><br />
<br />
= See all the connected client to fcitx =<br />
<pre><br />
# Same information is available in fcitx5-diagnose<br />
qdbus org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.DebugInfo<br />
</pre><br />
<br />
= Set current group =<br />
<pre><br />
qdbus org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.SwitchInputMethodGroup [group name]<br />
fcitx5-remote -g [group name]<br />
</pre></div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Table_(Fcitx_5)&diff=45796Table (Fcitx 5)2023-07-24T19:17:49Z<p>Weng Xuetian: Created page with "This is about the table engine in Fcitx 5. = Supported languages = The table engine is specifically designed to support special type of Input method used by Chinese. Those in..."</p>
<hr />
<div>This is about the table engine in Fcitx 5.<br />
<br />
= Supported languages =<br />
The table engine is specifically designed to support special type of Input method used by Chinese. Those input method converts a series of ascii key into one character or a word, like a dictionary "table". The table usually targets 1-to-1 mapping to reduce the requirements to make manual selection from multiple candidates word, but user will need to memorize the rules of how such table is encoded in order to type the characters. Commonly, the encoding is based on the strokes of Chinese characters, but there are also phonetic and stroke hybrid encoding to make it easier to memorize.<br />
<br />
While the engine itself is designed for Chinese input method, it can also be used to simulate certain keyboard layout or implement a phonetic style input method. Such tables are packaged in [https://pkgs.org/search/?q=fcitx5-table-other fcitx5-table-other], e.g. [[wikipedia:International Phonetic Alphabet|IPA]].<br />
<br />
= Features =<br />
== Auto select ==<br />
This is a feature that is usually referred as "顶功" in Chinese. It allows user to type directly without manually select from candidates. Usually it is used in two different ways:<br />
<br />
* When there is only one match and the typed code is large equal to certain length, the unique candidate will be selected automatically.<br />
* When it is impossible to find a match for the next typed key combined with existing input, the previous candidate will be selected automatically. <br />
<br />
== Sorting ==<br />
There are 3 different supported way of sorting the candidates. <br />
<br />
* No sort, which provides the stable order of candidates.<br />
* Fast, which will adjust the selected candidate to the first place immediately.<br />
* Frequency, which will adjust the candidate based on how frequency the word is typed. The more you type a certain word, it will be placed in the front in the candidate. <br />
<br />
== Modify dictionary on the fly ===<br />
The default binding is Ctrl + 8. You will need to type or select some text first in order to use this feature. When the table supports rule to create new mapping for a word, new word can be added manually with this feature.<br />
<br />
Another way is that if you want to forget a typed candidate, in order to reset the frequency, you can use the forget key, which is default binding to Ctrl + 7.<br />
<br />
== Reverse lookup ==<br />
There are mainly two ways of using this feature:<br />
1. press modify dictionary key<br />
2. Use pinyin key</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Using_Fcitx_5_on_Wayland&diff=45795Using Fcitx 5 on Wayland2023-07-20T22:17:56Z<p>Weng Xuetian: /* Desktop environment */</p>
<hr />
<div>[https://wayland.freedesktop.org/ Wayland] is the next generation of display server protocol. While the initial release of the protocol is in 2008, the support of input method is not really ideal.<br />
<br />
Also, using input method on Wayland-based compositor may require different setup to make it work, and certain features of fcitx that works under X11 are not yet supported by Wayland.<br />
<br />
This page will try to cover all the current information with some underlying details, and [[Special:MyLanguage/Setup Fcitx 5|Setup Fcitx 5]] is still generally useful.<br />
<br />
== Applications ==<br />
=== Legacy X11 application that runs under XWayland ===<br />
In a word, XWayland support for input method is as good as normal X11 display server. As long as you set the same environment variable, using Xwayland should not be a issue. This category includes: <br />
<br />
* Xlib-based (and also other toolkit based on Xlib, e.g. tk, SDL1, etc), e.g. xterm, rxvt. Make sure XMODIFIERS is set correctly.<br />
* Gtk2-based applications, similar to Xlib, but can use fcitx im module. Set GTK_IM_MODULE to fcitx will give it best experience.<br />
* SDL2-based applications that doesn't default to wayland. Set SDL_IM_MODULE to fcitx<br />
* electron, chromium, these are still default to X11, similar to Gtk2 case.<br />
* For Qt4 applcation, Qt 4 can only use X11. You will need to QT_IM_MODULE to fcitx. Same for Qt5+ that uses XCB (can be override with QT_QPA_PLATFORM=xcb).<br />
<br />
=== Gtk3 / Gtk4 ===<br />
Gtk3 and Gtk4 support text-input-v3 natively. At the same time, it's also possible to use fcitx im module under wayland. So, either GTK_IM_MODULE=wayland or GTK_IM_MODULE=fcitx works. There are some difference to it. text-input-v3<br />
<br />
=== Qt5 / Qt6 ===<br />
If your Qt application natively runs under Wayland, you can either unset QT_IM_MODULE to make it use text-input-v2, or set QT_IM_MODULE=fcitx to make it use fcitx im module.<br />
<br />
text-input-v2 is not upstreamed to wayland-protocols, that is probably why only kwin support it. This means in non-kwin environment, you will need to use QT_IM_MODULE=fcitx to make the Qt applications work.<br />
<br />
On Qt6, you may also use QT_IM_MODULE= (empty) or QT_IM_MODULE=wayland if your Qt vesion contains this https://codereview.qt-project.org/c/qt/qtwayland/+/416862.<br />
<br />
=== Native wayland application (winit) ===<br />
Most likely text-input-v3 is being used.<br />
<br />
=== Chromium / Electron ===<br />
{{warning|The information in this section may not be up to date to reflect upstream change, especially the default behavior when no option is changed.}}<br />
TL;DR version, if you use XWayland to run Chromium or Electron application, just install Gtk im module and GTK_IM_MODULE=fcitx the same way like X11.<br />
<br />
If you choose to run it natively under Wayland, for chromium you will need to use<br />
<br />
# If your compositor supports text-input-v1 protocol. Check the compositor section below.<br />
chromium --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime <br />
<br />
Or<br />
<br />
# You will get wrong position for the input method popup window, unless you use GNOME shell + kimpanel extension.<br />
chromium --enable-features=UseOzonePlatform --ozone-platform=wayland --gtk-version=4 <br />
<br />
For electron, only the first option is avaiable (electron does NOT support to run internal chromium with gtk4), e.g. for vscode<br />
<br />
# If your compositor supports text-input-v1 protocol. Check the compositor section below.<br />
code --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime<br />
<br />
By default it should run under Xwayland (As of 2023/02/25 on Archlinux/Chromium 110.0.5481.177), but some user also reports it is using wayland even the "Preferred Ozone Platform" is "Default". So to check whether it's really run with wayland, you can use xeyes or xwininfo. With xeyes, if it's an X11 window, the "eyes" will move with mouse, otherwise it's wayland. With xwininfo, if the mouse cursor changed to "+" shape, and click the window shows the window information, then it is a X11 window.<br />
<br />
You may force it to run with Wayland, or X11 with the flag <code>--ozone-platform=wayland</code> and <code>--ozone-platform=x11</code>. You may persistent this by changing the option "Preferred Ozone Platform" in chrome://flags. It has four values, "Default", "X11", "Wayland", "Auto".<br />
<br />
It's possible to make it use GTK_IM_MODULE if it runs with Gtk4 (only supported by chromium/chrome at this time, not electron) by passing <code>--gtk-version=4</code>.<br />
<br />
It's also possible to make it use text-input-v1 by passing <code>--enable-wayland-ime</code> in addition to the flag above.<br />
<br />
The Chromium support for text-input-v1 is not very stable and you may hit some random crash. E.g. in the past, version 112 has a crash bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1431532 , which is fixed in version 115. In the bug comment, Chromium developer claims this text-input-v1 is only supposed to be used internally and not well supported, so use this at your own risk though it's currently the only out of box option. <br />
<br />
You should only use one of <code>--enable-wayland-ime</code> or <code>--gtk-version=4</code>, depending on you want to use text-input-v1, or gtk4 im module. text-input-v1 works for kwin 5.27 and weston. Gtk4 im module works on all environment, but only GNOME with Kimpanel extension can display the popup window in the correct position.<br />
<br />
== Support in Wayland Compositor ==<br />
<br />
Even if you are using only native wayland applications, Xwayland is recommended to be enabled for following reason. If client side input panel in im module does not work, fcitx will fallback to a X11 window, instead of a wayland window. The reason for this is because wayland window can not be placed freely on the screen. On the contrary, even if im module can only pass a coordinate relative to the application window to fcitx, which make the coordinate position doesn't make much sense, if your application window size is "maximized", the coordinate may just be "right" if treated as the global coordinate. This makes X11 window a better option than a randomly placed wayland window.<br />
<br />
=== KDE Plasma ===<br />
* App/Compositor supports text-input-v2 and text-input-v3.<br />
* Comopositor/Application uses zwp_input_method_v1. <br />
* 5.27 additionally supports text-input-v1.<br />
* 5.24 usable zwp_input_method_v1 with fcitx5. Pre-5.24 there are lots of problems, always use fcitx im module instead.<br />
* Use "Virtual keyboard" KCM to launch fcitx5. This is required to use text-input protocol. If you launch fcitx this way, make sure you do not use "restart" in the tray menu, since the socket passed from KWin can not be reused with the newly restarted fcitx.<br />
<br />
=== GNOME ===<br />
* Application/Compositor uses text-input-v3<br />
* Compositor/Input Method uses ibus dbus protocol, so ibus frontend is required to be used.<br />
* Adding Fcitx 5 to autostart, it will replace any existing ibus-daemon upon start up so it will work out of box.<br />
* Popup candidate window is not able to be displayed over gnome-shell UI. Only solution is to use [[Special:MyLanguage/Kimpanel|Kimpanel]], [https://extensions.gnome.org/extension/261/kimpanel/ link to extension].<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Sway ===<br />
* Application/Compositor uses text-input-v3<br />
* Comopositor/Application uses zwp_input_method_v2, but it's partially implemented. You will need [https://github.com/swaywm/sway/pull/7226 this pull request] to make it show the popup candidate window for text-input-v3 client.<br />
* fcitx im module also works.<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Weston ===<br />
* Application/Compositor uses text-input-v1<br />
* Comopositor/Application uses zwp_input_method_v1.<br />
* Since it has no text-input-v3, which is more commonly used, im module is the only solution for Gtk/Qt, need to set GTK_IM_MODULE=fcitx and QT_IM_MODULE=fcitx.<br />
* Add following content to ~/.config/weston.ini to make it launch fcitx 5. (xwayland part is recommended to make fcitx work best, even if it's wayland)<br />
<br />
<pre><br />
[core]<br />
xwayland=true<br />
<br />
[input-method]<br />
path=/usr/bin/fcitx5<br />
</pre><br />
<br />
=== Other compositors ===<br />
Please check their upstream for more information. For wlroots based compositors, it is possible that they also support in the same way as Sway does, or zwp_input_method could also be unsupported.<br />
<br />
== Known Issues ==<br />
=== Fcitx managed XKB layout ===<br />
Unlike X11, there is no generic way to set XKB layout to compositor, which means it can only be implemented for every individual desktop. Right now, Fcitx managed layout only works for KDE Plasma.<br />
<br />
As for non-KDE desktop, in order to make this "semi" work you'll need to ensure following:<br />
<br />
* The system layout in the group should be the same as the actual xkb layout you configured for the compositor.<br />
* Configure only one layout.<br />
* If you need other layout for text typing (e.g. Arabic), just add them to the Fcitx. As long as the key is forwarded to fcitx, it should work.<br />
<br />
=== Popup candidate window ===<br />
Wayland does not have a global coordinate system for regular client, so for native wayland client, it is impossible for Fcitx to place a wayland surface at a certain position. In order for popup window to be placed at the correct position, there are following cases:<br />
* Xwayland have no problem and it should work as good as X11.<br />
* If zwp_input_method protocol can be used, it has a surface role to allow compositor to place the popup window for input method. This only works if client uses text-input protocol.<br />
* For GNOME, kimpanel extension can read window coordinate since it's running inside compositor. As long as im module can report relative coordinate, kimpanel extension can display the popup window at the correct position. As similar approach for Plasma kimpanel is planned, but not yet implemented.<br />
* For Gtk/Qt, fcitx's im module implement a way to render the popup with in the client process. This has some limitation because implemenation of xdg_popup in Gtk3/Qt5 doesn't support reposition the window. So show/hide trick is used to mitigate this, but it may cause window blinking. Fcitx tries not to move window if possible. You may also disable popup animation if you're using KWin to help reduce the blinking.<br />
<br />
=== Per-window input method state ===<br />
When zwp_input_method is used, essentially there is only one input context visible to fcitx, and fcitx cannot distinguish what application is being used. Which means the input method "active"/"inactivate" state is now "global".<br />
<br />
There is planned change to obtain the active application name and use "virtual" input context for wayland frontend. It's not yet in the stable version of Fcitx.</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Using_Fcitx_5_on_Wayland&diff=45794Using Fcitx 5 on Wayland2023-07-20T22:17:32Z<p>Weng Xuetian: /* Chromium / Electron */</p>
<hr />
<div>[https://wayland.freedesktop.org/ Wayland] is the next generation of display server protocol. While the initial release of the protocol is in 2008, the support of input method is not really ideal.<br />
<br />
Also, using input method on Wayland-based compositor may require different setup to make it work, and certain features of fcitx that works under X11 are not yet supported by Wayland.<br />
<br />
This page will try to cover all the current information with some underlying details, and [[Special:MyLanguage/Setup Fcitx 5|Setup Fcitx 5]] is still generally useful.<br />
<br />
== Applications ==<br />
=== Legacy X11 application that runs under XWayland ===<br />
In a word, XWayland support for input method is as good as normal X11 display server. As long as you set the same environment variable, using Xwayland should not be a issue. This category includes: <br />
<br />
* Xlib-based (and also other toolkit based on Xlib, e.g. tk, SDL1, etc), e.g. xterm, rxvt. Make sure XMODIFIERS is set correctly.<br />
* Gtk2-based applications, similar to Xlib, but can use fcitx im module. Set GTK_IM_MODULE to fcitx will give it best experience.<br />
* SDL2-based applications that doesn't default to wayland. Set SDL_IM_MODULE to fcitx<br />
* electron, chromium, these are still default to X11, similar to Gtk2 case.<br />
* For Qt4 applcation, Qt 4 can only use X11. You will need to QT_IM_MODULE to fcitx. Same for Qt5+ that uses XCB (can be override with QT_QPA_PLATFORM=xcb).<br />
<br />
=== Gtk3 / Gtk4 ===<br />
Gtk3 and Gtk4 support text-input-v3 natively. At the same time, it's also possible to use fcitx im module under wayland. So, either GTK_IM_MODULE=wayland or GTK_IM_MODULE=fcitx works. There are some difference to it. text-input-v3<br />
<br />
=== Qt5 / Qt6 ===<br />
If your Qt application natively runs under Wayland, you can either unset QT_IM_MODULE to make it use text-input-v2, or set QT_IM_MODULE=fcitx to make it use fcitx im module.<br />
<br />
text-input-v2 is not upstreamed to wayland-protocols, that is probably why only kwin support it. This means in non-kwin environment, you will need to use QT_IM_MODULE=fcitx to make the Qt applications work.<br />
<br />
On Qt6, you may also use QT_IM_MODULE= (empty) or QT_IM_MODULE=wayland if your Qt vesion contains this https://codereview.qt-project.org/c/qt/qtwayland/+/416862.<br />
<br />
=== Native wayland application (winit) ===<br />
Most likely text-input-v3 is being used.<br />
<br />
=== Chromium / Electron ===<br />
{{warning|The information in this section may not be up to date to reflect upstream change, especially the default behavior when no option is changed.}}<br />
TL;DR version, if you use XWayland to run Chromium or Electron application, just install Gtk im module and GTK_IM_MODULE=fcitx the same way like X11.<br />
<br />
If you choose to run it natively under Wayland, for chromium you will need to use<br />
<br />
# If your compositor supports text-input-v1 protocol. Check the compositor section below.<br />
chromium --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime <br />
<br />
Or<br />
<br />
# You will get wrong position for the input method popup window, unless you use GNOME shell + kimpanel extension.<br />
chromium --enable-features=UseOzonePlatform --ozone-platform=wayland --gtk-version=4 <br />
<br />
For electron, only the first option is avaiable (electron does NOT support to run internal chromium with gtk4), e.g. for vscode<br />
<br />
# If your compositor supports text-input-v1 protocol. Check the compositor section below.<br />
code --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime<br />
<br />
By default it should run under Xwayland (As of 2023/02/25 on Archlinux/Chromium 110.0.5481.177), but some user also reports it is using wayland even the "Preferred Ozone Platform" is "Default". So to check whether it's really run with wayland, you can use xeyes or xwininfo. With xeyes, if it's an X11 window, the "eyes" will move with mouse, otherwise it's wayland. With xwininfo, if the mouse cursor changed to "+" shape, and click the window shows the window information, then it is a X11 window.<br />
<br />
You may force it to run with Wayland, or X11 with the flag <code>--ozone-platform=wayland</code> and <code>--ozone-platform=x11</code>. You may persistent this by changing the option "Preferred Ozone Platform" in chrome://flags. It has four values, "Default", "X11", "Wayland", "Auto".<br />
<br />
It's possible to make it use GTK_IM_MODULE if it runs with Gtk4 (only supported by chromium/chrome at this time, not electron) by passing <code>--gtk-version=4</code>.<br />
<br />
It's also possible to make it use text-input-v1 by passing <code>--enable-wayland-ime</code> in addition to the flag above.<br />
<br />
The Chromium support for text-input-v1 is not very stable and you may hit some random crash. E.g. in the past, version 112 has a crash bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1431532 , which is fixed in version 115. In the bug comment, Chromium developer claims this text-input-v1 is only supposed to be used internally and not well supported, so use this at your own risk though it's currently the only out of box option. <br />
<br />
You should only use one of <code>--enable-wayland-ime</code> or <code>--gtk-version=4</code>, depending on you want to use text-input-v1, or gtk4 im module. text-input-v1 works for kwin 5.27 and weston. Gtk4 im module works on all environment, but only GNOME with Kimpanel extension can display the popup window in the correct position.<br />
<br />
== Desktop environment ==<br />
<br />
Even if you are using only native wayland applications, Xwayland is recommended to be enabled for following reason. If client side input panel in im module does not work, fcitx will fallback to a X11 window, instead of a wayland window. The reason for this is because wayland window can not be placed freely on the screen. On the contrary, even if im module can only pass a coordinate relative to the application window to fcitx, which make the coordinate position doesn't make much sense, if your application window size is "maximized", the coordinate may just be "right" if treated as the global coordinate. This makes X11 window a better option than a randomly placed wayland window.<br />
<br />
=== KDE Plasma ===<br />
* App/Compositor supports text-input-v2 and text-input-v3.<br />
* Comopositor/Application uses zwp_input_method_v1. <br />
* 5.27 additionally supports text-input-v1.<br />
* 5.24 usable zwp_input_method_v1 with fcitx5. Pre-5.24 there are lots of problems, always use fcitx im module instead.<br />
* Use "Virtual keyboard" KCM to launch fcitx5. This is required to use text-input protocol. If you launch fcitx this way, make sure you do not use "restart" in the tray menu, since the socket passed from KWin can not be reused with the newly restarted fcitx.<br />
<br />
=== GNOME ===<br />
* Application/Compositor uses text-input-v3<br />
* Compositor/Input Method uses ibus dbus protocol, so ibus frontend is required to be used.<br />
* Adding Fcitx 5 to autostart, it will replace any existing ibus-daemon upon start up so it will work out of box.<br />
* Popup candidate window is not able to be displayed over gnome-shell UI. Only solution is to use [[Special:MyLanguage/Kimpanel|Kimpanel]], [https://extensions.gnome.org/extension/261/kimpanel/ link to extension].<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Sway ===<br />
* Application/Compositor uses text-input-v3<br />
* Comopositor/Application uses zwp_input_method_v2, but it's partially implemented. You will need [https://github.com/swaywm/sway/pull/7226 this pull request] to make it show the popup candidate window for text-input-v3 client.<br />
* fcitx im module also works.<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Weston ===<br />
* Application/Compositor uses text-input-v1<br />
* Comopositor/Application uses zwp_input_method_v1.<br />
* Since it has no text-input-v3, which is more commonly used, im module is the only solution for Gtk/Qt, need to set GTK_IM_MODULE=fcitx and QT_IM_MODULE=fcitx.<br />
* Add following content to ~/.config/weston.ini to make it launch fcitx 5. (xwayland part is recommended to make fcitx work best, even if it's wayland)<br />
<br />
<pre><br />
[core]<br />
xwayland=true<br />
<br />
[input-method]<br />
path=/usr/bin/fcitx5<br />
</pre><br />
<br />
=== Other compositors ===<br />
Please check their upstream for more information. For wlroots based compositors, it is possible that they also support in the same way as Sway does, or zwp_input_method could also be unsupported.<br />
<br />
== Known Issues ==<br />
=== Fcitx managed XKB layout ===<br />
Unlike X11, there is no generic way to set XKB layout to compositor, which means it can only be implemented for every individual desktop. Right now, Fcitx managed layout only works for KDE Plasma.<br />
<br />
As for non-KDE desktop, in order to make this "semi" work you'll need to ensure following:<br />
<br />
* The system layout in the group should be the same as the actual xkb layout you configured for the compositor.<br />
* Configure only one layout.<br />
* If you need other layout for text typing (e.g. Arabic), just add them to the Fcitx. As long as the key is forwarded to fcitx, it should work.<br />
<br />
=== Popup candidate window ===<br />
Wayland does not have a global coordinate system for regular client, so for native wayland client, it is impossible for Fcitx to place a wayland surface at a certain position. In order for popup window to be placed at the correct position, there are following cases:<br />
* Xwayland have no problem and it should work as good as X11.<br />
* If zwp_input_method protocol can be used, it has a surface role to allow compositor to place the popup window for input method. This only works if client uses text-input protocol.<br />
* For GNOME, kimpanel extension can read window coordinate since it's running inside compositor. As long as im module can report relative coordinate, kimpanel extension can display the popup window at the correct position. As similar approach for Plasma kimpanel is planned, but not yet implemented.<br />
* For Gtk/Qt, fcitx's im module implement a way to render the popup with in the client process. This has some limitation because implemenation of xdg_popup in Gtk3/Qt5 doesn't support reposition the window. So show/hide trick is used to mitigate this, but it may cause window blinking. Fcitx tries not to move window if possible. You may also disable popup animation if you're using KWin to help reduce the blinking.<br />
<br />
=== Per-window input method state ===<br />
When zwp_input_method is used, essentially there is only one input context visible to fcitx, and fcitx cannot distinguish what application is being used. Which means the input method "active"/"inactivate" state is now "global".<br />
<br />
There is planned change to obtain the active application name and use "virtual" input context for wayland frontend. It's not yet in the stable version of Fcitx.</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Using_Fcitx_5_on_Wayland&diff=45793Using Fcitx 5 on Wayland2023-07-20T22:16:30Z<p>Weng Xuetian: /* Chromium / Electron */</p>
<hr />
<div>[https://wayland.freedesktop.org/ Wayland] is the next generation of display server protocol. While the initial release of the protocol is in 2008, the support of input method is not really ideal.<br />
<br />
Also, using input method on Wayland-based compositor may require different setup to make it work, and certain features of fcitx that works under X11 are not yet supported by Wayland.<br />
<br />
This page will try to cover all the current information with some underlying details, and [[Special:MyLanguage/Setup Fcitx 5|Setup Fcitx 5]] is still generally useful.<br />
<br />
== Applications ==<br />
=== Legacy X11 application that runs under XWayland ===<br />
In a word, XWayland support for input method is as good as normal X11 display server. As long as you set the same environment variable, using Xwayland should not be a issue. This category includes: <br />
<br />
* Xlib-based (and also other toolkit based on Xlib, e.g. tk, SDL1, etc), e.g. xterm, rxvt. Make sure XMODIFIERS is set correctly.<br />
* Gtk2-based applications, similar to Xlib, but can use fcitx im module. Set GTK_IM_MODULE to fcitx will give it best experience.<br />
* SDL2-based applications that doesn't default to wayland. Set SDL_IM_MODULE to fcitx<br />
* electron, chromium, these are still default to X11, similar to Gtk2 case.<br />
* For Qt4 applcation, Qt 4 can only use X11. You will need to QT_IM_MODULE to fcitx. Same for Qt5+ that uses XCB (can be override with QT_QPA_PLATFORM=xcb).<br />
<br />
=== Gtk3 / Gtk4 ===<br />
Gtk3 and Gtk4 support text-input-v3 natively. At the same time, it's also possible to use fcitx im module under wayland. So, either GTK_IM_MODULE=wayland or GTK_IM_MODULE=fcitx works. There are some difference to it. text-input-v3<br />
<br />
=== Qt5 / Qt6 ===<br />
If your Qt application natively runs under Wayland, you can either unset QT_IM_MODULE to make it use text-input-v2, or set QT_IM_MODULE=fcitx to make it use fcitx im module.<br />
<br />
text-input-v2 is not upstreamed to wayland-protocols, that is probably why only kwin support it. This means in non-kwin environment, you will need to use QT_IM_MODULE=fcitx to make the Qt applications work.<br />
<br />
On Qt6, you may also use QT_IM_MODULE= (empty) or QT_IM_MODULE=wayland if your Qt vesion contains this https://codereview.qt-project.org/c/qt/qtwayland/+/416862.<br />
<br />
=== Native wayland application (winit) ===<br />
Most likely text-input-v3 is being used.<br />
<br />
=== Chromium / Electron ===<br />
{{warning|The information in this section may not be up to date to reflect upstream change, especially the default behavior when no option is changed.}}<br />
TL;DR version, if you use XWayland to run Chromium or Electron application, just install Gtk im module and GTK_IM_MODULE=fcitx the same way like X11.<br />
<br />
If you choose to run it natively under Wayland, for chromium you will need to use<br />
<br />
# If your compositor supports text-input-v1 protocol.<br />
chromium --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime <br />
<br />
Or<br />
<br />
# You will get wrong position for the input method popup window, unless you use GNOME shell + kimpanel extension.<br />
chromium --enable-features=UseOzonePlatform --ozone-platform=wayland --gtk-version=4 <br />
<br />
For electron, only the first option is avaiable (electron does NOT support to run internal chromium with gtk4), e.g. for vscode<br />
<br />
# If your compositor supports text-input-v1 protocol.<br />
code --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime<br />
<br />
By default it should run under Xwayland (As of 2023/02/25 on Archlinux/Chromium 110.0.5481.177), but some user also reports it is using wayland even the "Preferred Ozone Platform" is "Default". So to check whether it's really run with wayland, you can use xeyes or xwininfo. With xeyes, if it's an X11 window, the "eyes" will move with mouse, otherwise it's wayland. With xwininfo, if the mouse cursor changed to "+" shape, and click the window shows the window information, then it is a X11 window.<br />
<br />
You may force it to run with Wayland, or X11 with the flag <code>--ozone-platform=wayland</code> and <code>--ozone-platform=x11</code>. You may persistent this by changing the option "Preferred Ozone Platform" in chrome://flags. It has four values, "Default", "X11", "Wayland", "Auto".<br />
<br />
It's possible to make it use GTK_IM_MODULE if it runs with Gtk4 (only supported by chromium/chrome at this time, not electron) by passing <code>--gtk-version=4</code>.<br />
<br />
It's also possible to make it use text-input-v1 by passing <code>--enable-wayland-ime</code> in addition to the flag above.<br />
<br />
The Chromium support for text-input-v1 is not very stable and you may hit some random crash. E.g. in the past, version 112 has a crash bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1431532 , which is fixed in version 115. In the bug comment, Chromium developer claims this text-input-v1 is only supposed to be used internally and not well supported, so use this at your own risk though it's currently the only out of box option. <br />
<br />
You should only use one of <code>--enable-wayland-ime</code> or <code>--gtk-version=4</code>, depending on you want to use text-input-v1, or gtk4 im module. text-input-v1 works for kwin 5.27 and weston. Gtk4 im module works on all environment, but only GNOME with Kimpanel extension can display the popup window in the correct position.<br />
<br />
== Desktop environment ==<br />
<br />
Even if you are using only native wayland applications, Xwayland is recommended to be enabled for following reason. If client side input panel in im module does not work, fcitx will fallback to a X11 window, instead of a wayland window. The reason for this is because wayland window can not be placed freely on the screen. On the contrary, even if im module can only pass a coordinate relative to the application window to fcitx, which make the coordinate position doesn't make much sense, if your application window size is "maximized", the coordinate may just be "right" if treated as the global coordinate. This makes X11 window a better option than a randomly placed wayland window.<br />
<br />
=== KDE Plasma ===<br />
* App/Compositor supports text-input-v2 and text-input-v3.<br />
* Comopositor/Application uses zwp_input_method_v1. <br />
* 5.27 additionally supports text-input-v1.<br />
* 5.24 usable zwp_input_method_v1 with fcitx5. Pre-5.24 there are lots of problems, always use fcitx im module instead.<br />
* Use "Virtual keyboard" KCM to launch fcitx5. This is required to use text-input protocol. If you launch fcitx this way, make sure you do not use "restart" in the tray menu, since the socket passed from KWin can not be reused with the newly restarted fcitx.<br />
<br />
=== GNOME ===<br />
* Application/Compositor uses text-input-v3<br />
* Compositor/Input Method uses ibus dbus protocol, so ibus frontend is required to be used.<br />
* Adding Fcitx 5 to autostart, it will replace any existing ibus-daemon upon start up so it will work out of box.<br />
* Popup candidate window is not able to be displayed over gnome-shell UI. Only solution is to use [[Special:MyLanguage/Kimpanel|Kimpanel]], [https://extensions.gnome.org/extension/261/kimpanel/ link to extension].<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Sway ===<br />
* Application/Compositor uses text-input-v3<br />
* Comopositor/Application uses zwp_input_method_v2, but it's partially implemented. You will need [https://github.com/swaywm/sway/pull/7226 this pull request] to make it show the popup candidate window for text-input-v3 client.<br />
* fcitx im module also works.<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Weston ===<br />
* Application/Compositor uses text-input-v1<br />
* Comopositor/Application uses zwp_input_method_v1.<br />
* Since it has no text-input-v3, which is more commonly used, im module is the only solution for Gtk/Qt, need to set GTK_IM_MODULE=fcitx and QT_IM_MODULE=fcitx.<br />
* Add following content to ~/.config/weston.ini to make it launch fcitx 5. (xwayland part is recommended to make fcitx work best, even if it's wayland)<br />
<br />
<pre><br />
[core]<br />
xwayland=true<br />
<br />
[input-method]<br />
path=/usr/bin/fcitx5<br />
</pre><br />
<br />
=== Other compositors ===<br />
Please check their upstream for more information. For wlroots based compositors, it is possible that they also support in the same way as Sway does, or zwp_input_method could also be unsupported.<br />
<br />
== Known Issues ==<br />
=== Fcitx managed XKB layout ===<br />
Unlike X11, there is no generic way to set XKB layout to compositor, which means it can only be implemented for every individual desktop. Right now, Fcitx managed layout only works for KDE Plasma.<br />
<br />
As for non-KDE desktop, in order to make this "semi" work you'll need to ensure following:<br />
<br />
* The system layout in the group should be the same as the actual xkb layout you configured for the compositor.<br />
* Configure only one layout.<br />
* If you need other layout for text typing (e.g. Arabic), just add them to the Fcitx. As long as the key is forwarded to fcitx, it should work.<br />
<br />
=== Popup candidate window ===<br />
Wayland does not have a global coordinate system for regular client, so for native wayland client, it is impossible for Fcitx to place a wayland surface at a certain position. In order for popup window to be placed at the correct position, there are following cases:<br />
* Xwayland have no problem and it should work as good as X11.<br />
* If zwp_input_method protocol can be used, it has a surface role to allow compositor to place the popup window for input method. This only works if client uses text-input protocol.<br />
* For GNOME, kimpanel extension can read window coordinate since it's running inside compositor. As long as im module can report relative coordinate, kimpanel extension can display the popup window at the correct position. As similar approach for Plasma kimpanel is planned, but not yet implemented.<br />
* For Gtk/Qt, fcitx's im module implement a way to render the popup with in the client process. This has some limitation because implemenation of xdg_popup in Gtk3/Qt5 doesn't support reposition the window. So show/hide trick is used to mitigate this, but it may cause window blinking. Fcitx tries not to move window if possible. You may also disable popup animation if you're using KWin to help reduce the blinking.<br />
<br />
=== Per-window input method state ===<br />
When zwp_input_method is used, essentially there is only one input context visible to fcitx, and fcitx cannot distinguish what application is being used. Which means the input method "active"/"inactivate" state is now "global".<br />
<br />
There is planned change to obtain the active application name and use "virtual" input context for wayland frontend. It's not yet in the stable version of Fcitx.</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Using_Fcitx_5_on_Wayland&diff=45792Using Fcitx 5 on Wayland2023-07-20T22:15:56Z<p>Weng Xuetian: /* Chromium / Electron */</p>
<hr />
<div>[https://wayland.freedesktop.org/ Wayland] is the next generation of display server protocol. While the initial release of the protocol is in 2008, the support of input method is not really ideal.<br />
<br />
Also, using input method on Wayland-based compositor may require different setup to make it work, and certain features of fcitx that works under X11 are not yet supported by Wayland.<br />
<br />
This page will try to cover all the current information with some underlying details, and [[Special:MyLanguage/Setup Fcitx 5|Setup Fcitx 5]] is still generally useful.<br />
<br />
== Applications ==<br />
=== Legacy X11 application that runs under XWayland ===<br />
In a word, XWayland support for input method is as good as normal X11 display server. As long as you set the same environment variable, using Xwayland should not be a issue. This category includes: <br />
<br />
* Xlib-based (and also other toolkit based on Xlib, e.g. tk, SDL1, etc), e.g. xterm, rxvt. Make sure XMODIFIERS is set correctly.<br />
* Gtk2-based applications, similar to Xlib, but can use fcitx im module. Set GTK_IM_MODULE to fcitx will give it best experience.<br />
* SDL2-based applications that doesn't default to wayland. Set SDL_IM_MODULE to fcitx<br />
* electron, chromium, these are still default to X11, similar to Gtk2 case.<br />
* For Qt4 applcation, Qt 4 can only use X11. You will need to QT_IM_MODULE to fcitx. Same for Qt5+ that uses XCB (can be override with QT_QPA_PLATFORM=xcb).<br />
<br />
=== Gtk3 / Gtk4 ===<br />
Gtk3 and Gtk4 support text-input-v3 natively. At the same time, it's also possible to use fcitx im module under wayland. So, either GTK_IM_MODULE=wayland or GTK_IM_MODULE=fcitx works. There are some difference to it. text-input-v3<br />
<br />
=== Qt5 / Qt6 ===<br />
If your Qt application natively runs under Wayland, you can either unset QT_IM_MODULE to make it use text-input-v2, or set QT_IM_MODULE=fcitx to make it use fcitx im module.<br />
<br />
text-input-v2 is not upstreamed to wayland-protocols, that is probably why only kwin support it. This means in non-kwin environment, you will need to use QT_IM_MODULE=fcitx to make the Qt applications work.<br />
<br />
On Qt6, you may also use QT_IM_MODULE= (empty) or QT_IM_MODULE=wayland if your Qt vesion contains this https://codereview.qt-project.org/c/qt/qtwayland/+/416862.<br />
<br />
=== Native wayland application (winit) ===<br />
Most likely text-input-v3 is being used.<br />
<br />
=== Chromium / Electron ===<br />
{{warning|The information in this section may not be up to date to reflect upstream change, especially the default behavior when no option is changed.}}<br />
You may force it to run with Wayland, or X11 with the flag <code>--ozone-platform=wayland</code> and <code>--ozone-platform=x11</code>. You may persistent this by changing the option "Preferred Ozone Platform" in chrome://flags. It has four values, "Default", "X11", "Wayland", "Auto".<br />
<br />
TL;DR version, if you use XWayland to run Chromium or Electron application, just install Gtk im module and GTK_IM_MODULE=fcitx the same way like X11.<br />
<br />
If you choose to run it natively under Wayland, for chromium you will need to use<br />
<br />
# If your compositor supports text-input-v1 protocol.<br />
chromium --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime <br />
<br />
Or<br />
<br />
# You will get wrong position for the input method popup window, unless you use GNOME shell + kimpanel extension.<br />
chromium --enable-features=UseOzonePlatform --ozone-platform=wayland --gtk-version=4 <br />
<br />
For electron, only the first option is avaiable (electron does NOT support to run internal chromium with gtk4), e.g. for vscode<br />
<br />
# If your compositor supports text-input-v1 protocol.<br />
code --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime<br />
<br />
By default it should run under Xwayland (As of 2023/02/25 on Archlinux/Chromium 110.0.5481.177), but some user also reports it is using wayland even the "Preferred Ozone Platform" is "Default". So to check whether it's really run with wayland, you can use xeyes or xwininfo. With xeyes, if it's an X11 window, the "eyes" will move with mouse, otherwise it's wayland. With xwininfo, if the mouse cursor changed to "+" shape, and click the window shows the window information, then it is a X11 window.<br />
<br />
It's possible to make it use GTK_IM_MODULE if it runs with Gtk4 (only supported by chromium/chrome at this time, not electron) by passing <code>--gtk-version=4</code>.<br />
<br />
It's also possible to make it use text-input-v1 by passing <code>--enable-wayland-ime</code> in addition to the flag above.<br />
<br />
The Chromium support for text-input-v1 is not very stable and you may hit some random crash. E.g. in the past, version 112 has a crash bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1431532 , which is fixed in version 115. In the bug comment, Chromium developer claims this text-input-v1 is only supposed to be used internally and not well supported, so use this at your own risk though it's currently the only out of box option. <br />
<br />
You should only use one of <code>--enable-wayland-ime</code> or <code>--gtk-version=4</code>, depending on you want to use text-input-v1, or gtk4 im module. text-input-v1 works for kwin 5.27 and weston. Gtk4 im module works on all environment, but only GNOME with Kimpanel extension can display the popup window in the correct position.<br />
<br />
== Desktop environment ==<br />
<br />
Even if you are using only native wayland applications, Xwayland is recommended to be enabled for following reason. If client side input panel in im module does not work, fcitx will fallback to a X11 window, instead of a wayland window. The reason for this is because wayland window can not be placed freely on the screen. On the contrary, even if im module can only pass a coordinate relative to the application window to fcitx, which make the coordinate position doesn't make much sense, if your application window size is "maximized", the coordinate may just be "right" if treated as the global coordinate. This makes X11 window a better option than a randomly placed wayland window.<br />
<br />
=== KDE Plasma ===<br />
* App/Compositor supports text-input-v2 and text-input-v3.<br />
* Comopositor/Application uses zwp_input_method_v1. <br />
* 5.27 additionally supports text-input-v1.<br />
* 5.24 usable zwp_input_method_v1 with fcitx5. Pre-5.24 there are lots of problems, always use fcitx im module instead.<br />
* Use "Virtual keyboard" KCM to launch fcitx5. This is required to use text-input protocol. If you launch fcitx this way, make sure you do not use "restart" in the tray menu, since the socket passed from KWin can not be reused with the newly restarted fcitx.<br />
<br />
=== GNOME ===<br />
* Application/Compositor uses text-input-v3<br />
* Compositor/Input Method uses ibus dbus protocol, so ibus frontend is required to be used.<br />
* Adding Fcitx 5 to autostart, it will replace any existing ibus-daemon upon start up so it will work out of box.<br />
* Popup candidate window is not able to be displayed over gnome-shell UI. Only solution is to use [[Special:MyLanguage/Kimpanel|Kimpanel]], [https://extensions.gnome.org/extension/261/kimpanel/ link to extension].<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Sway ===<br />
* Application/Compositor uses text-input-v3<br />
* Comopositor/Application uses zwp_input_method_v2, but it's partially implemented. You will need [https://github.com/swaywm/sway/pull/7226 this pull request] to make it show the popup candidate window for text-input-v3 client.<br />
* fcitx im module also works.<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Weston ===<br />
* Application/Compositor uses text-input-v1<br />
* Comopositor/Application uses zwp_input_method_v1.<br />
* Since it has no text-input-v3, which is more commonly used, im module is the only solution for Gtk/Qt, need to set GTK_IM_MODULE=fcitx and QT_IM_MODULE=fcitx.<br />
* Add following content to ~/.config/weston.ini to make it launch fcitx 5. (xwayland part is recommended to make fcitx work best, even if it's wayland)<br />
<br />
<pre><br />
[core]<br />
xwayland=true<br />
<br />
[input-method]<br />
path=/usr/bin/fcitx5<br />
</pre><br />
<br />
=== Other compositors ===<br />
Please check their upstream for more information. For wlroots based compositors, it is possible that they also support in the same way as Sway does, or zwp_input_method could also be unsupported.<br />
<br />
== Known Issues ==<br />
=== Fcitx managed XKB layout ===<br />
Unlike X11, there is no generic way to set XKB layout to compositor, which means it can only be implemented for every individual desktop. Right now, Fcitx managed layout only works for KDE Plasma.<br />
<br />
As for non-KDE desktop, in order to make this "semi" work you'll need to ensure following:<br />
<br />
* The system layout in the group should be the same as the actual xkb layout you configured for the compositor.<br />
* Configure only one layout.<br />
* If you need other layout for text typing (e.g. Arabic), just add them to the Fcitx. As long as the key is forwarded to fcitx, it should work.<br />
<br />
=== Popup candidate window ===<br />
Wayland does not have a global coordinate system for regular client, so for native wayland client, it is impossible for Fcitx to place a wayland surface at a certain position. In order for popup window to be placed at the correct position, there are following cases:<br />
* Xwayland have no problem and it should work as good as X11.<br />
* If zwp_input_method protocol can be used, it has a surface role to allow compositor to place the popup window for input method. This only works if client uses text-input protocol.<br />
* For GNOME, kimpanel extension can read window coordinate since it's running inside compositor. As long as im module can report relative coordinate, kimpanel extension can display the popup window at the correct position. As similar approach for Plasma kimpanel is planned, but not yet implemented.<br />
* For Gtk/Qt, fcitx's im module implement a way to render the popup with in the client process. This has some limitation because implemenation of xdg_popup in Gtk3/Qt5 doesn't support reposition the window. So show/hide trick is used to mitigate this, but it may cause window blinking. Fcitx tries not to move window if possible. You may also disable popup animation if you're using KWin to help reduce the blinking.<br />
<br />
=== Per-window input method state ===<br />
When zwp_input_method is used, essentially there is only one input context visible to fcitx, and fcitx cannot distinguish what application is being used. Which means the input method "active"/"inactivate" state is now "global".<br />
<br />
There is planned change to obtain the active application name and use "virtual" input context for wayland frontend. It's not yet in the stable version of Fcitx.</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=How_does_an_application_talk_to_Fcitx&diff=45791How does an application talk to Fcitx2023-04-24T18:13:59Z<p>Weng Xuetian: Created page with "This article is intended to explain some histories and underlying details about how Fcitx works from an application point of view, and answers some question about why sometime..."</p>
<hr />
<div>This article is intended to explain some histories and underlying details about how Fcitx works from an application point of view, and answers some question about why sometimes an application does not work.<br />
<br />
The relationship between an application and Fcitx basically follows [[wikipedia:Client–server_model|Client-server model]]. An applications may act as one or more clients to Fcitx. Every "Client" is called an "Input context" from Fcitx point of view. Fcitx and the application need to use some way to talk to each other. In Fcitx 5, the addon category that is responsible to the communication to application are called "frontend".<br />
<br />
= X11 =<br />
There is a generic input method protocol implemented with X, call [https://www.x.org/releases/X11R7.6/doc/libX11/specs/XIM/xim.html X Input method]. The most common used implementation of this protocol is within Xlib.<br />
<br />
The latest version of this protocol was written in 90s. The protocol itself is old, and the implementation in Xlib is even worse.<br />
<br />
The usability issue of XIM drives Linux input method developer to create their own "protocols", which leads to a solution usually referred as "IM module".<br />
<br />
= Gtk/Qt =<br />
IM module itself is just a plugin system uses by two most commonly used toolkit Gtk/Qt. The plugin system allows user to load a shared library (in most common case), or link a static plugin (if Qt itself is statically linked) to produce the functionality of input method.<br />
<br />
Fcitx uses this plugin system to implement a [https://dbus.freedesktop.org D-Bus based protocol] to talk to [https://github.com/fcitx/fcitx5/tree/master/src/frontend/dbusfrontend Fcitx's dbus frontend].<br />
<br />
Gtk2, Gtk3, and Qt4 also ship an IM module that implements XIM. When Qt5 migrates from Xlib to XCB as the library to implement X11 integration, it loses the XIM support. Because at that time, there is no XCB based implementation of XIM. Gtk4 removes XIM support because its considered it as deprecated.<br />
<br />
Usually, there are multiple IM module plugins installed on the system. If the relevant environment variable is not set, it will follow some logic in the toolkit to pick up one. To ensure the right IM module is picked by application, there are some [[Special:MyLanguage/Input_method_related_environment_variables|environment variables]] can be used to enforce the desired IM module.<br />
<br />
Also, since sandbox-based applications like flatpak are become more and more popular today, it actually requires the sandboxed application to bundle the IM module with their application. Fcitx team already makes the most commonly used flatpak runtimes (org.freedesktop.Sdk, org.gnome.Sdk, org.kde.Sdk) to bundle the im modules.<br />
<br />
Fcitx 5 also supports fcitx 4's dbus protocol and IBus's dbus protocol.<br />
<br />
= SDL =<br />
SDL1 supports XIM. SDL2 has a similar issue like Qt5 and it loses XIM SDL does not provide a shared library based plugin system like Gtk or Qt, but SDL2 also bundles Fcitx support within it and can be enforced with SDL_IM_MODULE=fcitx.<br />
<br />
= Wayland =<br />
There are several version of text-input protocol on wayland and being used by different toolkits and applications. [[Special:MyLanguage/Using_Fcitx_5_on_Wayland#Applications|This page]] describes the current situation.<br />
<br />
= Some random applications =<br />
== kitty ==<br />
kitty uses IBus protocol on X11 if GLFW_IM_MODULE is set to ibus.<br />
== Emacs ==<br />
Emacs usually uses Gtk as its toolkit on Linux, but it's input method is using XIM with its own Xlib code. Latest Emacs that uses pure Gtk branch may use Gtk IM module framework as its input method implementation.<br />
== Chrome/Chromium/Electron ==<br />
On X11 its using Gtk im module like regular Gtk application. On wayland, check [[Special:MyLanguage/Using_Fcitx_5_on_Wayland#Chromium_.2F_Electron|this section]] for more details.</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Debug_fcitx5&diff=45790Debug fcitx52023-04-24T17:30:45Z<p>Weng Xuetian: /* Start Fcitx within a nested X server */</p>
<hr />
<div>= Print logs =<br />
This is a common way to debug something that you can attach to it. <code>FCITX_INFO()</code> is a convenient macro for print out information. It is a thin wrapper around std::ostream. It supports not only all types supported by <code>std::ostream</code>, but also common Standard C++ containers and Fcitx own types such as <code>fcitx::RawConfig</code>, <code>fcitx::Color</code>, <code>fcitx::Key</code>, etc.<br />
<br />
The logging with in Fcitx also provides log category so you may explicitly enable certain log only when you want to debug.<br />
<br />
= GDB or other debuggers =<br />
Debugging Fcitx is no different from debugging other C/C++ programs. The only thing that makes it special is that Fcitx is an input method and you need keyboard typing working to do runtime debug like gdb.<br />
<br />
So, either you run gdb within an application that is input method disabled, or you want to disable certain addon that talks to your terminal.<br />
<br />
== Start an input method disabled terminal ==<br />
1. Start a terminal with XMODIFIERS set to some random values, <code>XMODIFIERS=@im=none xterm</code> (or other terminal that uses XIM)<br />
2. Within the xterm, start Fcitx that with correct XMODIFIERS. Fcitx will read the XMODIFIERS from the environment to set its own value, but right now xterm will have <code>XMODIFIERS=@im=none</code>, so you need to override it again to make it mismatch with XMODIFIERS value of xterm. That will make xterm fail to connect to the Fcitx XIM server.<br />
<br />
== Start Fcitx with certain frontend disabled ==<br />
If your environment is set up correctly and you are using a Gtk/Qt based terminal, such as konsole/gnome-terminal, you can also start Fcitx with dbusfrontend disabled, so it will not talk to Gtk/Qt im module. <code>gdb --args fcitx5 --disable=dbusfrontend -r</code> <br />
<br />
You should still be able to use a XIM application to test, such as xterm.<br />
<br />
== Start Fcitx within a nested X server ==<br />
This special procedure is useful when you want to debug something that requires you to type a sequence of keys. This is because whenever you switch to a different window, the input method will receives focus out and that will commonly reset the state of input method. In that case, it may prevent you from reproducing the issue that requires a sequence of interactions.<br />
<br />
Using a nested X server, such as Xephyr, will prevent the focus out event to be generated.<br />
<br />
<nowiki>Xephyr :1 &<br />
DISPLAY=:1 openbox & #Start a window manager<br />
DISPLAY=:1 xterm & #Start a XIM application<br />
DISPLAY=:1 gdb --args fcitx --disable dbusfrontend -r # Start Fcitx with dbus frontend disabled</nowiki><br />
<br />
= Use fcitx test addons to reproduce the issue or write new test cases =<br />
By default, Fcitx will come with a few test addons that is designed to generate synthetic user interaction. [https://codedocs.xyz/fcitx/fcitx5/group__FcitxUtils.html#ga81328a61b82a27934eea82d9f494a53d fcitx::setupTestingEnvironment] provides a easy way to setup required environment variables to run a special testing only fcitx instance.<br />
<br />
Usually, you would need to create an [https://codedocs.xyz/fcitx/fcitx5/classfcitx_1_1EventDispatcher.html event dispatcher] to execute some code after Fcitx is initialized. You can check [https://github.com/fcitx/fcitx5/blob/master/test/testunicode.cpp testunicode] as a reference.<br />
<br />
You may also want to explicitly enable only required addons to limit the testing scope.</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=FAQ&diff=45440FAQ2023-02-26T04:53:39Z<p>Weng Xuetian: Marked this version for translation</p>
<hr />
<div><languages/><br />
<translate><br />
<br />
<!--T:1--><br />
When you want to complain about input method cannot work correctly, please read this first.<br />
<br />
<!--T:72--><br />
Since 4.2.7, fcitx provides a command called fcitx-diagnose, it will try to detect some common problem and give some advice.<br />
<br />
<!--T:2--><br />
[[Special:MyLanguage/Hall of Shame for Linux IME Support|Hall of Shame for Linux IME Support]]<br />
<br />
== When use Ctrl + Space, Fcitx cannot be triggered on == <!--T:3--><br />
<br />
<!--T:37--><br />
Check the application you want to type into.<br />
<br />
=== Wayland === <!--T:84--> <br />
<br />
<!--T:89--><br />
See [[Special:MyLanguage/Using Fcitx 5 on Wayland|Using Fcitx 5 on Wayland]].<br />
<br />
=== Only one specific app has problem? === <!--T:61--><br />
* The most possible reason for this is Ctrl+Space occupied by some hotkey, please change to another trigger key and try again. This usually happens in some editor, since many ide use Ctrl+Space as default key binding for Completion.<br />
<br />
=== All Gtk Apps have problem? === <!--T:62--><br />
* Please open a traditional Gtk App (traditional Gtk App means, it cannot be Firefox, Libreoffice, which only use Gtk as a UI style). Gedit is a good choice. Right click at the input box, there will be a menu named "Input Method", please make sure there is "Fcitx" in it and being choosed.<br />
<br />
<!--T:63--><br />
* If there is "Fcitx", but it still not works. Please try to restart Fcitx, if it will works at this time, please check your DBus settings, or make Fcitx start later. You can read [[Special:MyLanguage/Configure (Other)|Configure (Other)]] if you're using a custom startup script.<br />
<br />
<!--T:64--><br />
* If there is Fcitx but not being choosed by default, and please select it and you can immediately try again in this app. If not works, please read the entry above. For permanent fix (To use Fcitx by default), please read Configure part in [[Special:MyLanguage/Install And Configure|Install And Configure]].<br />
<br />
<!--T:65--><br />
* If there is no Fcitx, you should check your install first. Usually, the package name contains fcitx and gtk. If you [[Special:MyLanguage/Compile from source|compile fcitx from source]], please make sure you have enable GTK{2,3}_IM_MODULE option. If you're sure about this, please read [[Special:MyLanguage/Input method related environment variables|Input method related environment variables]] for how to update some cached file for gtk.<br />
<br />
<!--T:38--><br />
* If you are using Ubuntu and upgrade to 12.04 recently, or something werid happens to your system (Due to packager careless, or buggy package manager which can not do upgrade in correct order, for example, [https://bugs.archlinux.org/task/32764 pacman]), you might notice that gtk.immodules related files doesn't generate correctly during upgrade. Try uninstall {{package ubuntu|fcitx-frontend-gtk2}}, {{package ubuntu|fcitx-frontend-gtk3}} or coressponding package on your system and re-install them to trigger the file generate. Then recheck the input method menu to see whether it have "Fcitx" in the menu or not.<br />
<br />
=== All Qt Apps have problem? === <!--T:66--><br />
* Run qtconfig (might have different name on your distribution, it might be qtconfig-qt4), and go to the third tab, make sure fcitx is in the "Default Input Method" combo-box. If not, please check your install.<br />
* Above solution can also applies if you want use XIM, but still we highly recommend you to use im module. See Also [[Special:MyLanguage/Input method related environment variables|Input method related environment variables]].<br />
<br />
==== Telegram desktop ==== <!--T:77--><br />
Some distribution enables Qt6 for telegram desktop. Just make sure you have the Qt6 im module (For fcitx4, it's fcitx-qt6 on archlinux).<br />
<br />
=== Chromium or any other chromium based browser (E.g. Microsoft Edge) === <!--T:85--><br />
For Chromium running under X11, if you are using startx to start your graphical user interface, you may hit [https://gitlab.freedesktop.org/xorg/app/xinit/-/issues/9 an issue] in startx that unset the DBUS_SESSION_BUS_ADDRESS, which prevent chromium based browser from using dbus correctly. To mitigate this, you may:<br />
<br />
<!--T:86--><br />
1. either export DBUS_SESSION_BUS_ADDRESS by yourself in your ~/.xinitrc (or simply change to use ~/.xsession if you are using debian based system).<br />
<br />
<!--T:87--><br />
2. or use a display manager like sddm, gdm, lightdm instead of startx.<br />
<br />
<!--T:88--><br />
For Chromium that runs natively under wayland, the only native wayland input method protocol it supports is text-input-v1, which is only supported by weston. Alternatively, it can also use Gtk4's im module, you can use following flag (---enable-features=UseOzonePlatform --ozone-platform=wayland --gtk-version=4) to make it use Gtk im module, but it doesn't fully work in terms of popup window position unless you are using kimpanel + GNOME.<br />
<br />
=== Is it Java, Xterm, wine, or some other non-Gtk/Qt Application? === <!--T:39--><br />
There are also some very rare case, that you're using a embedded linux or mini-linux distro, in which you must use XIM, the X server might missing some locale file. The file is usually needed to be under /usr/share/X11/locale/.<br />
<br />
<!--T:40--><br />
And When you must use XIM, please make sure, your locale '''must NOT''' be C or POSIX and need to be a valid locale (no matter which language), and need to be generated if you are using glibc (locale-gen). When you are using im module, there is no such limitation.<br />
<br />
=== Is it a Qt application that bundles its own Qt library? === <!--T:74--><br />
Bundled Qt library usually uses theirs own plugin directory, which is different from system's Qt. And commonly, they are also using Qt different on system Qt, which will also make it incompatible if you simply copy the system fcitx-qt files. But anyway, you can start to check whether it loads your copied files with following environment variable. Depending on how the XIM application is written, it may need to find specific font to make it work. On Archlinux xorg-mkfontscale is required to generate correct font dir files. After install it, you'll need to restart X Server to make it work.<br />
<br />
<!--T:75--><br />
QT_DEBUG_PLUGINS=1 QT_LOGGING_RULES="*.debug=true"<br />
<br />
<!--T:76--><br />
And try to resolve all incompatible errors. Usually, ubuntu's fcitx-frontend-qt5 and libfcitxqt5-1 are good source for fcitx-qt5 build against specific qt version. For example, DraftSight 2017S0 [https://groups.google.com/forum/#!topic/fcitx/9e4TI39_4sk] may work with xenial's fcitx-qt5.<br />
<br />
=== Emacs === <!--T:67--><br />
Try<br />
<br />
<!--T:68--><br />
LC_CTYPE=zh_CN.UTF-8 emacs<br />
<br />
<!--T:69--><br />
Don't forget to check your locale -a contains that. See also [[Special:MyLanguage/Input method related environment variables|Input method related environment variables]].<br />
<br />
<!--T:70--><br />
Emacs will use `-*-*-*-r-normal--<some font size>-*-*-*-*-*-*-*' as basefont(in src/xfns.c), if you do not have one matched, the code for input method won't run. Install some font package may help (For required fonts xorg-fonts-misc might be the right package but you can also try other xorg-fonts-* package.). <br />
<br />
=== Non Gtk/Qt Wayland Application (Alacritty, kitty, etc) === <!--T:78--><br />
It is possible that the application you use does not support input method at all, because they need to have relevant code to implement it. Even if they do, it is highly possible that compositor does not have the support for input method. Only GNOME Shell and KWin has full text-input-v3 support. As of 2022/05/07, sway still does not have full zwp_input_method_v2 support to support input surface. For KWin, you will need Plasma 5.24+ and Fcitx 5.0.14+ and make KWin to start Fcitx 5. You will need to go to Virtual Keyboard KCM and select Fcitx 5 in the KCM.<br />
<br />
== Candidate window is blinking under wayland with Fcitx 5 == <!--T:79--><br />
This is mainly due to the whole poor state of wayland input method. The existing wayland input method protocol is not widely supported by compositor. Even though fcitx 5 support those protocols, the poor support in application and compositor make them not usable. Not to mention certain design flaw within the protocol.<br />
<br />
<!--T:80--><br />
In order to make input method some what usable with '''CURRENTLY''' available and widely adopted techniques, Fcitx 5 implements a mechanism called "Client Side Input Panel", which basically asks client application to render the input window. This is done through dbus and IM Module for Gtk/Qt. The implementation requires using a underlying wayland protocol xdg_popup to show the window. Unfortunately, only new version of xdg_popup protocol supports '''moving''' a visible popup window, and this part is '''NOT''' implemented in Gtk3 and Qt5. What makes it even worse is that Gtk3 and Qt5 both comes to their end of life, which means it is not possible to get this new protocol support in Gtk3/Qt5. The issue is that input method requires to display a window that resizes and moves extremely frequently. To mitigate this issue, Fcitx 5 IM Module implement a hack that when we need to move the window, it will hide the window first and then show the window. Unfortunately, this would cause certain-level of blinking. It might looks bad in certain hardware and compositor combination.<br />
<br />
<!--T:81--><br />
Here is some possible workaround for this.<br />
<br />
<!--T:82--><br />
1. Use kimpanel under GNOME shell, which will make the candidate window to be rendered with a totally different mechanism, which won't cause any blinking. <br />
<br />
<!--T:83--><br />
2. Disable Fade-in and Fade-Out effect under KWin. KWin seems to tolerate such blink much better than certain compositor.<br />
<br />
== Problem in Firefox and Google Docs == <!--T:4--><br />
<br />
<!--T:41--><br />
You might want to toggle preedit off temporarily, which is Ctrl+Alt+P.<br />
<br />
== Cannot use Fcitx in flash == <!--T:5--><br />
<br />
<!--T:42--><br />
Please read [[Special:MyLanguage/Hall of Shame for Linux IME Support|Hall of Shame for Linux IME Support]], and use im module.<br />
<br />
== Cannot type English after updating to fcitx newer than 4.2.4 == <!--T:6--><br />
<br />
<!--T:43--><br />
Make sure you have add "[[Special:myLanguage/Keyboard|Keyboard]]" to the input method list. You can use [[Special:myLanguage/Integrate with Desktop#Configuration tool|Configuration tool]].<br />
<br />
<!--T:44--><br />
And you may want to move "Keyboard" to the first one.<br />
<br />
== Unexpected keyboard layout change == <!--T:7--><br />
<br />
<!--T:45--><br />
Use [[Special:myLanguage/Integrate with Desktop#Configuration tool|Configuration tool]], to bind specific keyboard layout to the specific input method.<br />
<br />
== xmodmap settings being overwritten == <!--T:8--><br />
<br />
<!--T:46--><br />
Fcitx now control keyboard layout and when switch layout, xmodmap setting will be overwritten. So fcitx-xkb provides an option to specify the xmodmap script and let fcitx loads it for you whenever keyboard layout changes. Or disable fcitx-xkb addon is also a solution for you, or if your requirement is simply, for example, switching Caps Lock and Esc, which is provided by xkb option, you can just set it with your desktop keyboard configuration tool (Gnome and KDE all support such configuration).<br />
<br />
<!--T:47--><br />
For more detailed explanation, xmodmap is a very low level tool, that doesn't aware keyboard layout. For X11, keyboard layout is built on a set of profile, when such profile is loaded, anything you changed with xmodmap will be overwritten, this isn't specific to fcitx, but all tool that support keyboard layout configuration. Xkb option is a set of profile that can do some pre-defined change over keyboard layout, including many thing that people usually do with xmodmap, for example, defining where dead key is, switching Caps Lock and Esc, and so on. Unless you have special requirements, xkb layout and xkb option is recommended.<br />
<br />
<!--T:71--><br />
Since 4.2.7, Fcitx will try to load ~/.Xmodmap if it exists.<br />
<br />
== Configure user interface, font, vertical list == <!--T:9--><br />
<br />
<!--T:48--><br />
Use [[Special:myLanguage/Integrate with Desktop#Configuration tool|Configuration tool]], Addon Configuration -> Classic UI.<br />
<br />
<!--T:49--><br />
If you are using [[Special:myLanguage/Configtool|fcitx-configtool]] newer than 0.4.5 or [[Special:myLanguage/Kcm|kcm-fcitx]] newer 0.4.1, you can directly configure those from the first level tab.<br />
<br />
== Possible issue for GNOME 3.6 == <!--T:10--><br />
<br />
<!--T:50--><br />
[[Note for GNOME Later than 3.6]]<br />
<br />
== [[Special:MyLanguage/ClassicUI|Classic UI]] is not transparent == <!--T:11--><br />
<br />
* This problem might NOT exist any more since 4.2.6 with a different approach for detect composite manager.<br />
* Restart Fcitx first, if it's ok then, it might be a bug in your Window manager. Gnome-Shell, xcompmgr is known to have this bug. You can try to set the delay start to walkaround this problem.<br />
* If restart Fcitx doesn't solve this problem, you should check whether your window manager supports composite or it's enabled or not.<br />
=== Kwin === <!--T:51--><br />
<br />
Enable desktop effects.<br />
=== Metacity before GNOME3 === <!--T:52--><br />
<br />
gconftool-2 -s --type bool /apps/metacity/general/compositing_manager true<br />
=== Xfce === <!--T:53--><br />
<br />
Xfwm support composite, but need to be enabled by hand.<br />
=== Compiz === <!--T:54--><br />
<br />
0.9 series compiz can disable composite. You can use ccsm to configure it.<br />
=== Other window manager === <!--T:55--><br />
<br />
<!--T:56--><br />
You can use xcompmgr, cairo-compmgr as composite manager for them.<br />
<br />
== Minecraft == <!--T:12--><br />
<br />
<!--T:34--><br />
Original Minecraft under linux doesn't support input method, what make it worse is, XIM will conflict with its key event processing, one way to work around is, set a wrong environment variable on purpose for minecraft, then start up it. You can use following script to do that<br />
<br />
<!--T:35--><br />
<pre>#!/bin/sh<br />
# set a wrong one<br />
export XMODIFIERS="@im=null"<br />
# start minecraft, this might change depends on you're mod, but simply its what you ARE using to start minecraft.<br />
java -Xmx1024M -Xms512M -cp minecraft.jar net.minecraft.LauncherFrame</pre><br />
<br />
<!--T:58--><br />
This way can be also used, if you don't want fcitx to work on some application which is using XIM.<br />
<br />
<!--T:73--><br />
There is a mod can be used to support input under Linux, called [http://forum.minecraftuser.jp/viewtopic.php?t=6279 NihongoMOD], 1.2.2 with minecraft 1.5.2 can work with Fcitx without upper hack.<br />
<br />
== Root application under normal user X == <!--T:57--><br />
Root application under X normal user session is always broken (in general, not specific to fcitx), due to the fact that dbus is a user session only process. The only way to type in root application with normal fcitx is to use XIM, set GTK_IM_MODULE=xim and QT_IM_MODULE=xim before you start your application.<br />
<br />
== Cursor Following problem == <!--T:13--><br />
There is a common misunderstanding that it's input method's fault that input window could not follow the cursor, which is simply wrong. This is how cursor following works: Application send the position to Input method, then input method move the input window. So if application do not send the position, the position would be wrong. This behavior is controlled by application, but not input method. So if you meet any problem, please ask application to fix it, don't ask input method to do anything. Actually, input method could do nothing with this.<br />
<br />
<!--T:59--><br />
Although there is some walkaround for specific problem, bug is still in application, not in input method.<br />
<br />
<!--T:60--><br />
* Opera, enable on the spot for [[Special:MyLanguage/XIM|XIM]].<br />
* Firefox, enable preedit.<br />
<br />
<!--T:14--><br />
[[Category:How-to]]<br />
<br />
</translate></div>Weng Xuetianhttps://fcitx-im.org/index.php?title=FAQ&diff=45439FAQ2023-02-26T04:53:23Z<p>Weng Xuetian: </p>
<hr />
<div><languages/><br />
<translate><br />
<br />
<!--T:1--><br />
When you want to complain about input method cannot work correctly, please read this first.<br />
<br />
<!--T:72--><br />
Since 4.2.7, fcitx provides a command called fcitx-diagnose, it will try to detect some common problem and give some advice.<br />
<br />
<!--T:2--><br />
[[Special:MyLanguage/Hall of Shame for Linux IME Support|Hall of Shame for Linux IME Support]]<br />
<br />
== When use Ctrl + Space, Fcitx cannot be triggered on == <!--T:3--><br />
<br />
<!--T:37--><br />
Check the application you want to type into.<br />
<br />
<!--T:84--><br />
=== Wayland === <br />
<br />
See [[Special:MyLanguage/Using Fcitx 5 on Wayland|Using Fcitx 5 on Wayland]].<br />
<br />
=== Only one specific app has problem? === <!--T:61--><br />
* The most possible reason for this is Ctrl+Space occupied by some hotkey, please change to another trigger key and try again. This usually happens in some editor, since many ide use Ctrl+Space as default key binding for Completion.<br />
<br />
=== All Gtk Apps have problem? === <!--T:62--><br />
* Please open a traditional Gtk App (traditional Gtk App means, it cannot be Firefox, Libreoffice, which only use Gtk as a UI style). Gedit is a good choice. Right click at the input box, there will be a menu named "Input Method", please make sure there is "Fcitx" in it and being choosed.<br />
<br />
<!--T:63--><br />
* If there is "Fcitx", but it still not works. Please try to restart Fcitx, if it will works at this time, please check your DBus settings, or make Fcitx start later. You can read [[Special:MyLanguage/Configure (Other)|Configure (Other)]] if you're using a custom startup script.<br />
<br />
<!--T:64--><br />
* If there is Fcitx but not being choosed by default, and please select it and you can immediately try again in this app. If not works, please read the entry above. For permanent fix (To use Fcitx by default), please read Configure part in [[Special:MyLanguage/Install And Configure|Install And Configure]].<br />
<br />
<!--T:65--><br />
* If there is no Fcitx, you should check your install first. Usually, the package name contains fcitx and gtk. If you [[Special:MyLanguage/Compile from source|compile fcitx from source]], please make sure you have enable GTK{2,3}_IM_MODULE option. If you're sure about this, please read [[Special:MyLanguage/Input method related environment variables|Input method related environment variables]] for how to update some cached file for gtk.<br />
<br />
<!--T:38--><br />
* If you are using Ubuntu and upgrade to 12.04 recently, or something werid happens to your system (Due to packager careless, or buggy package manager which can not do upgrade in correct order, for example, [https://bugs.archlinux.org/task/32764 pacman]), you might notice that gtk.immodules related files doesn't generate correctly during upgrade. Try uninstall {{package ubuntu|fcitx-frontend-gtk2}}, {{package ubuntu|fcitx-frontend-gtk3}} or coressponding package on your system and re-install them to trigger the file generate. Then recheck the input method menu to see whether it have "Fcitx" in the menu or not.<br />
<br />
=== All Qt Apps have problem? === <!--T:66--><br />
* Run qtconfig (might have different name on your distribution, it might be qtconfig-qt4), and go to the third tab, make sure fcitx is in the "Default Input Method" combo-box. If not, please check your install.<br />
* Above solution can also applies if you want use XIM, but still we highly recommend you to use im module. See Also [[Special:MyLanguage/Input method related environment variables|Input method related environment variables]].<br />
<br />
==== Telegram desktop ==== <!--T:77--><br />
Some distribution enables Qt6 for telegram desktop. Just make sure you have the Qt6 im module (For fcitx4, it's fcitx-qt6 on archlinux).<br />
<br />
=== Chromium or any other chromium based browser (E.g. Microsoft Edge) === <!--T:85--><br />
For Chromium running under X11, if you are using startx to start your graphical user interface, you may hit [https://gitlab.freedesktop.org/xorg/app/xinit/-/issues/9 an issue] in startx that unset the DBUS_SESSION_BUS_ADDRESS, which prevent chromium based browser from using dbus correctly. To mitigate this, you may:<br />
<br />
<!--T:86--><br />
1. either export DBUS_SESSION_BUS_ADDRESS by yourself in your ~/.xinitrc (or simply change to use ~/.xsession if you are using debian based system).<br />
<br />
<!--T:87--><br />
2. or use a display manager like sddm, gdm, lightdm instead of startx.<br />
<br />
<!--T:88--><br />
For Chromium that runs natively under wayland, the only native wayland input method protocol it supports is text-input-v1, which is only supported by weston. Alternatively, it can also use Gtk4's im module, you can use following flag (---enable-features=UseOzonePlatform --ozone-platform=wayland --gtk-version=4) to make it use Gtk im module, but it doesn't fully work in terms of popup window position unless you are using kimpanel + GNOME.<br />
<br />
=== Is it Java, Xterm, wine, or some other non-Gtk/Qt Application? === <!--T:39--><br />
There are also some very rare case, that you're using a embedded linux or mini-linux distro, in which you must use XIM, the X server might missing some locale file. The file is usually needed to be under /usr/share/X11/locale/.<br />
<br />
<!--T:40--><br />
And When you must use XIM, please make sure, your locale '''must NOT''' be C or POSIX and need to be a valid locale (no matter which language), and need to be generated if you are using glibc (locale-gen). When you are using im module, there is no such limitation.<br />
<br />
=== Is it a Qt application that bundles its own Qt library? === <!--T:74--><br />
Bundled Qt library usually uses theirs own plugin directory, which is different from system's Qt. And commonly, they are also using Qt different on system Qt, which will also make it incompatible if you simply copy the system fcitx-qt files. But anyway, you can start to check whether it loads your copied files with following environment variable. Depending on how the XIM application is written, it may need to find specific font to make it work. On Archlinux xorg-mkfontscale is required to generate correct font dir files. After install it, you'll need to restart X Server to make it work.<br />
<br />
<!--T:75--><br />
QT_DEBUG_PLUGINS=1 QT_LOGGING_RULES="*.debug=true"<br />
<br />
<!--T:76--><br />
And try to resolve all incompatible errors. Usually, ubuntu's fcitx-frontend-qt5 and libfcitxqt5-1 are good source for fcitx-qt5 build against specific qt version. For example, DraftSight 2017S0 [https://groups.google.com/forum/#!topic/fcitx/9e4TI39_4sk] may work with xenial's fcitx-qt5.<br />
<br />
=== Emacs === <!--T:67--><br />
Try<br />
<br />
<!--T:68--><br />
LC_CTYPE=zh_CN.UTF-8 emacs<br />
<br />
<!--T:69--><br />
Don't forget to check your locale -a contains that. See also [[Special:MyLanguage/Input method related environment variables|Input method related environment variables]].<br />
<br />
<!--T:70--><br />
Emacs will use `-*-*-*-r-normal--<some font size>-*-*-*-*-*-*-*' as basefont(in src/xfns.c), if you do not have one matched, the code for input method won't run. Install some font package may help (For required fonts xorg-fonts-misc might be the right package but you can also try other xorg-fonts-* package.). <br />
<br />
=== Non Gtk/Qt Wayland Application (Alacritty, kitty, etc) === <!--T:78--><br />
It is possible that the application you use does not support input method at all, because they need to have relevant code to implement it. Even if they do, it is highly possible that compositor does not have the support for input method. Only GNOME Shell and KWin has full text-input-v3 support. As of 2022/05/07, sway still does not have full zwp_input_method_v2 support to support input surface. For KWin, you will need Plasma 5.24+ and Fcitx 5.0.14+ and make KWin to start Fcitx 5. You will need to go to Virtual Keyboard KCM and select Fcitx 5 in the KCM.<br />
<br />
== Candidate window is blinking under wayland with Fcitx 5 == <!--T:79--><br />
This is mainly due to the whole poor state of wayland input method. The existing wayland input method protocol is not widely supported by compositor. Even though fcitx 5 support those protocols, the poor support in application and compositor make them not usable. Not to mention certain design flaw within the protocol.<br />
<br />
<!--T:80--><br />
In order to make input method some what usable with '''CURRENTLY''' available and widely adopted techniques, Fcitx 5 implements a mechanism called "Client Side Input Panel", which basically asks client application to render the input window. This is done through dbus and IM Module for Gtk/Qt. The implementation requires using a underlying wayland protocol xdg_popup to show the window. Unfortunately, only new version of xdg_popup protocol supports '''moving''' a visible popup window, and this part is '''NOT''' implemented in Gtk3 and Qt5. What makes it even worse is that Gtk3 and Qt5 both comes to their end of life, which means it is not possible to get this new protocol support in Gtk3/Qt5. The issue is that input method requires to display a window that resizes and moves extremely frequently. To mitigate this issue, Fcitx 5 IM Module implement a hack that when we need to move the window, it will hide the window first and then show the window. Unfortunately, this would cause certain-level of blinking. It might looks bad in certain hardware and compositor combination.<br />
<br />
<!--T:81--><br />
Here is some possible workaround for this.<br />
<br />
<!--T:82--><br />
1. Use kimpanel under GNOME shell, which will make the candidate window to be rendered with a totally different mechanism, which won't cause any blinking. <br />
<br />
<!--T:83--><br />
2. Disable Fade-in and Fade-Out effect under KWin. KWin seems to tolerate such blink much better than certain compositor.<br />
<br />
== Problem in Firefox and Google Docs == <!--T:4--><br />
<br />
<!--T:41--><br />
You might want to toggle preedit off temporarily, which is Ctrl+Alt+P.<br />
<br />
== Cannot use Fcitx in flash == <!--T:5--><br />
<br />
<!--T:42--><br />
Please read [[Special:MyLanguage/Hall of Shame for Linux IME Support|Hall of Shame for Linux IME Support]], and use im module.<br />
<br />
== Cannot type English after updating to fcitx newer than 4.2.4 == <!--T:6--><br />
<br />
<!--T:43--><br />
Make sure you have add "[[Special:myLanguage/Keyboard|Keyboard]]" to the input method list. You can use [[Special:myLanguage/Integrate with Desktop#Configuration tool|Configuration tool]].<br />
<br />
<!--T:44--><br />
And you may want to move "Keyboard" to the first one.<br />
<br />
== Unexpected keyboard layout change == <!--T:7--><br />
<br />
<!--T:45--><br />
Use [[Special:myLanguage/Integrate with Desktop#Configuration tool|Configuration tool]], to bind specific keyboard layout to the specific input method.<br />
<br />
== xmodmap settings being overwritten == <!--T:8--><br />
<br />
<!--T:46--><br />
Fcitx now control keyboard layout and when switch layout, xmodmap setting will be overwritten. So fcitx-xkb provides an option to specify the xmodmap script and let fcitx loads it for you whenever keyboard layout changes. Or disable fcitx-xkb addon is also a solution for you, or if your requirement is simply, for example, switching Caps Lock and Esc, which is provided by xkb option, you can just set it with your desktop keyboard configuration tool (Gnome and KDE all support such configuration).<br />
<br />
<!--T:47--><br />
For more detailed explanation, xmodmap is a very low level tool, that doesn't aware keyboard layout. For X11, keyboard layout is built on a set of profile, when such profile is loaded, anything you changed with xmodmap will be overwritten, this isn't specific to fcitx, but all tool that support keyboard layout configuration. Xkb option is a set of profile that can do some pre-defined change over keyboard layout, including many thing that people usually do with xmodmap, for example, defining where dead key is, switching Caps Lock and Esc, and so on. Unless you have special requirements, xkb layout and xkb option is recommended.<br />
<br />
<!--T:71--><br />
Since 4.2.7, Fcitx will try to load ~/.Xmodmap if it exists.<br />
<br />
== Configure user interface, font, vertical list == <!--T:9--><br />
<br />
<!--T:48--><br />
Use [[Special:myLanguage/Integrate with Desktop#Configuration tool|Configuration tool]], Addon Configuration -> Classic UI.<br />
<br />
<!--T:49--><br />
If you are using [[Special:myLanguage/Configtool|fcitx-configtool]] newer than 0.4.5 or [[Special:myLanguage/Kcm|kcm-fcitx]] newer 0.4.1, you can directly configure those from the first level tab.<br />
<br />
== Possible issue for GNOME 3.6 == <!--T:10--><br />
<br />
<!--T:50--><br />
[[Note for GNOME Later than 3.6]]<br />
<br />
== [[Special:MyLanguage/ClassicUI|Classic UI]] is not transparent == <!--T:11--><br />
<br />
* This problem might NOT exist any more since 4.2.6 with a different approach for detect composite manager.<br />
* Restart Fcitx first, if it's ok then, it might be a bug in your Window manager. Gnome-Shell, xcompmgr is known to have this bug. You can try to set the delay start to walkaround this problem.<br />
* If restart Fcitx doesn't solve this problem, you should check whether your window manager supports composite or it's enabled or not.<br />
=== Kwin === <!--T:51--><br />
<br />
Enable desktop effects.<br />
=== Metacity before GNOME3 === <!--T:52--><br />
<br />
gconftool-2 -s --type bool /apps/metacity/general/compositing_manager true<br />
=== Xfce === <!--T:53--><br />
<br />
Xfwm support composite, but need to be enabled by hand.<br />
=== Compiz === <!--T:54--><br />
<br />
0.9 series compiz can disable composite. You can use ccsm to configure it.<br />
=== Other window manager === <!--T:55--><br />
<br />
<!--T:56--><br />
You can use xcompmgr, cairo-compmgr as composite manager for them.<br />
<br />
== Minecraft == <!--T:12--><br />
<br />
<!--T:34--><br />
Original Minecraft under linux doesn't support input method, what make it worse is, XIM will conflict with its key event processing, one way to work around is, set a wrong environment variable on purpose for minecraft, then start up it. You can use following script to do that<br />
<br />
<!--T:35--><br />
<pre>#!/bin/sh<br />
# set a wrong one<br />
export XMODIFIERS="@im=null"<br />
# start minecraft, this might change depends on you're mod, but simply its what you ARE using to start minecraft.<br />
java -Xmx1024M -Xms512M -cp minecraft.jar net.minecraft.LauncherFrame</pre><br />
<br />
<!--T:58--><br />
This way can be also used, if you don't want fcitx to work on some application which is using XIM.<br />
<br />
<!--T:73--><br />
There is a mod can be used to support input under Linux, called [http://forum.minecraftuser.jp/viewtopic.php?t=6279 NihongoMOD], 1.2.2 with minecraft 1.5.2 can work with Fcitx without upper hack.<br />
<br />
== Root application under normal user X == <!--T:57--><br />
Root application under X normal user session is always broken (in general, not specific to fcitx), due to the fact that dbus is a user session only process. The only way to type in root application with normal fcitx is to use XIM, set GTK_IM_MODULE=xim and QT_IM_MODULE=xim before you start your application.<br />
<br />
== Cursor Following problem == <!--T:13--><br />
There is a common misunderstanding that it's input method's fault that input window could not follow the cursor, which is simply wrong. This is how cursor following works: Application send the position to Input method, then input method move the input window. So if application do not send the position, the position would be wrong. This behavior is controlled by application, but not input method. So if you meet any problem, please ask application to fix it, don't ask input method to do anything. Actually, input method could do nothing with this.<br />
<br />
<!--T:59--><br />
Although there is some walkaround for specific problem, bug is still in application, not in input method.<br />
<br />
<!--T:60--><br />
* Opera, enable on the spot for [[Special:MyLanguage/XIM|XIM]].<br />
* Firefox, enable preedit.<br />
<br />
<!--T:14--><br />
[[Category:How-to]]<br />
<br />
</translate></div>Weng Xuetianhttps://fcitx-im.org/index.php?title=FAQ&diff=45431FAQ2023-02-26T04:50:24Z<p>Weng Xuetian: Marked this version for translation</p>
<hr />
<div><languages/><br />
<translate><br />
<br />
<!--T:1--><br />
When you want to complain about input method cannot work correctly, please read this first.<br />
<br />
<!--T:72--><br />
Since 4.2.7, fcitx provides a command called fcitx-diagnose, it will try to detect some common problem and give some advice.<br />
<br />
<!--T:2--><br />
[[Special:MyLanguage/Hall of Shame for Linux IME Support|Hall of Shame for Linux IME Support]]<br />
<br />
== When use Ctrl + Space, Fcitx cannot be triggered on == <!--T:3--><br />
<br />
=== Wayland === <!--T:84--><br />
See [[Special:MyLanguage/Using Fcitx 5 on Wayland|Using Fcitx 5 on Wayland]].<br />
<br />
<!--T:37--><br />
Check the application you want to type.<br />
<br />
=== Only one specific app has problem? === <!--T:61--><br />
* The most possible reason for this is Ctrl+Space occupied by some hotkey, please change to another trigger key and try again. This usually happens in some editor, since many ide use Ctrl+Space as default key binding for Completion.<br />
<br />
=== All Gtk Apps have problem? === <!--T:62--><br />
* Please open a traditional Gtk App (traditional Gtk App means, it cannot be Firefox, Libreoffice, which only use Gtk as a UI style). Gedit is a good choice. Right click at the input box, there will be a menu named "Input Method", please make sure there is "Fcitx" in it and being choosed.<br />
<br />
<!--T:63--><br />
* If there is "Fcitx", but it still not works. Please try to restart Fcitx, if it will works at this time, please check your DBus settings, or make Fcitx start later. You can read [[Special:MyLanguage/Configure (Other)|Configure (Other)]] if you're using a custom startup script.<br />
<br />
<!--T:64--><br />
* If there is Fcitx but not being choosed by default, and please select it and you can immediately try again in this app. If not works, please read the entry above. For permanent fix (To use Fcitx by default), please read Configure part in [[Special:MyLanguage/Install And Configure|Install And Configure]].<br />
<br />
<!--T:65--><br />
* If there is no Fcitx, you should check your install first. Usually, the package name contains fcitx and gtk. If you [[Special:MyLanguage/Compile from source|compile fcitx from source]], please make sure you have enable GTK{2,3}_IM_MODULE option. If you're sure about this, please read [[Special:MyLanguage/Input method related environment variables|Input method related environment variables]] for how to update some cached file for gtk.<br />
<br />
<!--T:38--><br />
* If you are using Ubuntu and upgrade to 12.04 recently, or something werid happens to your system (Due to packager careless, or buggy package manager which can not do upgrade in correct order, for example, [https://bugs.archlinux.org/task/32764 pacman]), you might notice that gtk.immodules related files doesn't generate correctly during upgrade. Try uninstall {{package ubuntu|fcitx-frontend-gtk2}}, {{package ubuntu|fcitx-frontend-gtk3}} or coressponding package on your system and re-install them to trigger the file generate. Then recheck the input method menu to see whether it have "Fcitx" in the menu or not.<br />
<br />
=== All Qt Apps have problem? === <!--T:66--><br />
* Run qtconfig (might have different name on your distribution, it might be qtconfig-qt4), and go to the third tab, make sure fcitx is in the "Default Input Method" combo-box. If not, please check your install.<br />
* Above solution can also applies if you want use XIM, but still we highly recommend you to use im module. See Also [[Special:MyLanguage/Input method related environment variables|Input method related environment variables]].<br />
<br />
==== Telegram desktop ==== <!--T:77--><br />
Some distribution enables Qt6 for telegram desktop. Just make sure you have the Qt6 im module (For fcitx4, it's fcitx-qt6 on archlinux).<br />
<br />
=== Chromium or any other chromium based browser (E.g. Microsoft Edge) === <!--T:85--><br />
For Chromium running under X11, if you are using startx to start your graphical user interface, you may hit [https://gitlab.freedesktop.org/xorg/app/xinit/-/issues/9 an issue] in startx that unset the DBUS_SESSION_BUS_ADDRESS, which prevent chromium based browser from using dbus correctly. To mitigate this, you may:<br />
<br />
<!--T:86--><br />
1. either export DBUS_SESSION_BUS_ADDRESS by yourself in your ~/.xinitrc (or simply change to use ~/.xsession if you are using debian based system).<br />
<br />
<!--T:87--><br />
2. or use a display manager like sddm, gdm, lightdm instead of startx.<br />
<br />
<!--T:88--><br />
For Chromium that runs natively under wayland, the only native wayland input method protocol it supports is text-input-v1, which is only supported by weston. Alternatively, it can also use Gtk4's im module, you can use following flag (---enable-features=UseOzonePlatform --ozone-platform=wayland --gtk-version=4) to make it use Gtk im module, but it doesn't fully work in terms of popup window position unless you are using kimpanel + GNOME.<br />
<br />
=== Is it Java, Xterm, wine, or some other non-Gtk/Qt Application? === <!--T:39--><br />
There are also some very rare case, that you're using a embedded linux or mini-linux distro, in which you must use XIM, the X server might missing some locale file. The file is usually needed to be under /usr/share/X11/locale/.<br />
<br />
<!--T:40--><br />
And When you must use XIM, please make sure, your locale '''must NOT''' be C or POSIX and need to be a valid locale (no matter which language), and need to be generated if you are using glibc (locale-gen). When you are using im module, there is no such limitation.<br />
<br />
=== Is it a Qt application that bundles its own Qt library? === <!--T:74--><br />
Bundled Qt library usually uses theirs own plugin directory, which is different from system's Qt. And commonly, they are also using Qt different on system Qt, which will also make it incompatible if you simply copy the system fcitx-qt files. But anyway, you can start to check whether it loads your copied files with following environment variable. Depending on how the XIM application is written, it may need to find specific font to make it work. On Archlinux xorg-mkfontscale is required to generate correct font dir files. After install it, you'll need to restart X Server to make it work.<br />
<br />
<!--T:75--><br />
QT_DEBUG_PLUGINS=1 QT_LOGGING_RULES="*.debug=true"<br />
<br />
<!--T:76--><br />
And try to resolve all incompatible errors. Usually, ubuntu's fcitx-frontend-qt5 and libfcitxqt5-1 are good source for fcitx-qt5 build against specific qt version. For example, DraftSight 2017S0 [https://groups.google.com/forum/#!topic/fcitx/9e4TI39_4sk] may work with xenial's fcitx-qt5.<br />
<br />
=== Emacs === <!--T:67--><br />
Try<br />
<br />
<!--T:68--><br />
LC_CTYPE=zh_CN.UTF-8 emacs<br />
<br />
<!--T:69--><br />
Don't forget to check your locale -a contains that. See also [[Special:MyLanguage/Input method related environment variables|Input method related environment variables]].<br />
<br />
<!--T:70--><br />
Emacs will use `-*-*-*-r-normal--<some font size>-*-*-*-*-*-*-*' as basefont(in src/xfns.c), if you do not have one matched, the code for input method won't run. Install some font package may help (For required fonts xorg-fonts-misc might be the right package but you can also try other xorg-fonts-* package.). <br />
<br />
=== Non Gtk/Qt Wayland Application (Alacritty, kitty, etc) === <!--T:78--><br />
It is possible that the application you use does not support input method at all, because they need to have relevant code to implement it. Even if they do, it is highly possible that compositor does not have the support for input method. Only GNOME Shell and KWin has full text-input-v3 support. As of 2022/05/07, sway still does not have full zwp_input_method_v2 support to support input surface. For KWin, you will need Plasma 5.24+ and Fcitx 5.0.14+ and make KWin to start Fcitx 5. You will need to go to Virtual Keyboard KCM and select Fcitx 5 in the KCM.<br />
<br />
== Candidate window is blinking under wayland with Fcitx 5 == <!--T:79--><br />
This is mainly due to the whole poor state of wayland input method. The existing wayland input method protocol is not widely supported by compositor. Even though fcitx 5 support those protocols, the poor support in application and compositor make them not usable. Not to mention certain design flaw within the protocol.<br />
<br />
<!--T:80--><br />
In order to make input method some what usable with '''CURRENTLY''' available and widely adopted techniques, Fcitx 5 implements a mechanism called "Client Side Input Panel", which basically asks client application to render the input window. This is done through dbus and IM Module for Gtk/Qt. The implementation requires using a underlying wayland protocol xdg_popup to show the window. Unfortunately, only new version of xdg_popup protocol supports '''moving''' a visible popup window, and this part is '''NOT''' implemented in Gtk3 and Qt5. What makes it even worse is that Gtk3 and Qt5 both comes to their end of life, which means it is not possible to get this new protocol support in Gtk3/Qt5. The issue is that input method requires to display a window that resizes and moves extremely frequently. To mitigate this issue, Fcitx 5 IM Module implement a hack that when we need to move the window, it will hide the window first and then show the window. Unfortunately, this would cause certain-level of blinking. It might looks bad in certain hardware and compositor combination.<br />
<br />
<!--T:81--><br />
Here is some possible workaround for this.<br />
<br />
<!--T:82--><br />
1. Use kimpanel under GNOME shell, which will make the candidate window to be rendered with a totally different mechanism, which won't cause any blinking. <br />
<br />
<!--T:83--><br />
2. Disable Fade-in and Fade-Out effect under KWin. KWin seems to tolerate such blink much better than certain compositor.<br />
<br />
== Problem in Firefox and Google Docs == <!--T:4--><br />
<br />
<!--T:41--><br />
You might want to toggle preedit off temporarily, which is Ctrl+Alt+P.<br />
<br />
== Cannot use Fcitx in flash == <!--T:5--><br />
<br />
<!--T:42--><br />
Please read [[Special:MyLanguage/Hall of Shame for Linux IME Support|Hall of Shame for Linux IME Support]], and use im module.<br />
<br />
== Cannot type English after updating to fcitx newer than 4.2.4 == <!--T:6--><br />
<br />
<!--T:43--><br />
Make sure you have add "[[Special:myLanguage/Keyboard|Keyboard]]" to the input method list. You can use [[Special:myLanguage/Integrate with Desktop#Configuration tool|Configuration tool]].<br />
<br />
<!--T:44--><br />
And you may want to move "Keyboard" to the first one.<br />
<br />
== Unexpected keyboard layout change == <!--T:7--><br />
<br />
<!--T:45--><br />
Use [[Special:myLanguage/Integrate with Desktop#Configuration tool|Configuration tool]], to bind specific keyboard layout to the specific input method.<br />
<br />
== xmodmap settings being overwritten == <!--T:8--><br />
<br />
<!--T:46--><br />
Fcitx now control keyboard layout and when switch layout, xmodmap setting will be overwritten. So fcitx-xkb provides an option to specify the xmodmap script and let fcitx loads it for you whenever keyboard layout changes. Or disable fcitx-xkb addon is also a solution for you, or if your requirement is simply, for example, switching Caps Lock and Esc, which is provided by xkb option, you can just set it with your desktop keyboard configuration tool (Gnome and KDE all support such configuration).<br />
<br />
<!--T:47--><br />
For more detailed explanation, xmodmap is a very low level tool, that doesn't aware keyboard layout. For X11, keyboard layout is built on a set of profile, when such profile is loaded, anything you changed with xmodmap will be overwritten, this isn't specific to fcitx, but all tool that support keyboard layout configuration. Xkb option is a set of profile that can do some pre-defined change over keyboard layout, including many thing that people usually do with xmodmap, for example, defining where dead key is, switching Caps Lock and Esc, and so on. Unless you have special requirements, xkb layout and xkb option is recommended.<br />
<br />
<!--T:71--><br />
Since 4.2.7, Fcitx will try to load ~/.Xmodmap if it exists.<br />
<br />
== Configure user interface, font, vertical list == <!--T:9--><br />
<br />
<!--T:48--><br />
Use [[Special:myLanguage/Integrate with Desktop#Configuration tool|Configuration tool]], Addon Configuration -> Classic UI.<br />
<br />
<!--T:49--><br />
If you are using [[Special:myLanguage/Configtool|fcitx-configtool]] newer than 0.4.5 or [[Special:myLanguage/Kcm|kcm-fcitx]] newer 0.4.1, you can directly configure those from the first level tab.<br />
<br />
== Possible issue for GNOME 3.6 == <!--T:10--><br />
<br />
<!--T:50--><br />
[[Note for GNOME Later than 3.6]]<br />
<br />
== [[Special:MyLanguage/ClassicUI|Classic UI]] is not transparent == <!--T:11--><br />
<br />
* This problem might NOT exist any more since 4.2.6 with a different approach for detect composite manager.<br />
* Restart Fcitx first, if it's ok then, it might be a bug in your Window manager. Gnome-Shell, xcompmgr is known to have this bug. You can try to set the delay start to walkaround this problem.<br />
* If restart Fcitx doesn't solve this problem, you should check whether your window manager supports composite or it's enabled or not.<br />
=== Kwin === <!--T:51--><br />
<br />
Enable desktop effects.<br />
=== Metacity before GNOME3 === <!--T:52--><br />
<br />
gconftool-2 -s --type bool /apps/metacity/general/compositing_manager true<br />
=== Xfce === <!--T:53--><br />
<br />
Xfwm support composite, but need to be enabled by hand.<br />
=== Compiz === <!--T:54--><br />
<br />
0.9 series compiz can disable composite. You can use ccsm to configure it.<br />
=== Other window manager === <!--T:55--><br />
<br />
<!--T:56--><br />
You can use xcompmgr, cairo-compmgr as composite manager for them.<br />
<br />
== Minecraft == <!--T:12--><br />
<br />
<!--T:34--><br />
Original Minecraft under linux doesn't support input method, what make it worse is, XIM will conflict with its key event processing, one way to work around is, set a wrong environment variable on purpose for minecraft, then start up it. You can use following script to do that<br />
<br />
<!--T:35--><br />
<pre>#!/bin/sh<br />
# set a wrong one<br />
export XMODIFIERS="@im=null"<br />
# start minecraft, this might change depends on you're mod, but simply its what you ARE using to start minecraft.<br />
java -Xmx1024M -Xms512M -cp minecraft.jar net.minecraft.LauncherFrame</pre><br />
<br />
<!--T:58--><br />
This way can be also used, if you don't want fcitx to work on some application which is using XIM.<br />
<br />
<!--T:73--><br />
There is a mod can be used to support input under Linux, called [http://forum.minecraftuser.jp/viewtopic.php?t=6279 NihongoMOD], 1.2.2 with minecraft 1.5.2 can work with Fcitx without upper hack.<br />
<br />
== Root application under normal user X == <!--T:57--><br />
Root application under X normal user session is always broken (in general, not specific to fcitx), due to the fact that dbus is a user session only process. The only way to type in root application with normal fcitx is to use XIM, set GTK_IM_MODULE=xim and QT_IM_MODULE=xim before you start your application.<br />
<br />
== Cursor Following problem == <!--T:13--><br />
There is a common misunderstanding that it's input method's fault that input window could not follow the cursor, which is simply wrong. This is how cursor following works: Application send the position to Input method, then input method move the input window. So if application do not send the position, the position would be wrong. This behavior is controlled by application, but not input method. So if you meet any problem, please ask application to fix it, don't ask input method to do anything. Actually, input method could do nothing with this.<br />
<br />
<!--T:59--><br />
Although there is some walkaround for specific problem, bug is still in application, not in input method.<br />
<br />
<!--T:60--><br />
* Opera, enable on the spot for [[Special:MyLanguage/XIM|XIM]].<br />
* Firefox, enable preedit.<br />
<br />
<!--T:14--><br />
[[Category:How-to]]<br />
<br />
</translate></div>Weng Xuetianhttps://fcitx-im.org/index.php?title=FAQ&diff=45430FAQ2023-02-26T04:49:55Z<p>Weng Xuetian: /* Chromium or any other chromium based browser (E.g. Microsoft Edge) */</p>
<hr />
<div><languages/><br />
<translate><br />
<br />
<!--T:1--><br />
When you want to complain about input method cannot work correctly, please read this first.<br />
<br />
<!--T:72--><br />
Since 4.2.7, fcitx provides a command called fcitx-diagnose, it will try to detect some common problem and give some advice.<br />
<br />
<!--T:2--><br />
[[Special:MyLanguage/Hall of Shame for Linux IME Support|Hall of Shame for Linux IME Support]]<br />
<br />
== When use Ctrl + Space, Fcitx cannot be triggered on == <!--T:3--><br />
<br />
=== Wayland ===<br />
See [[Special:MyLanguage/Using Fcitx 5 on Wayland|Using Fcitx 5 on Wayland]].<br />
<br />
<!--T:37--><br />
Check the application you want to type.<br />
<br />
=== Only one specific app has problem? === <!--T:61--><br />
* The most possible reason for this is Ctrl+Space occupied by some hotkey, please change to another trigger key and try again. This usually happens in some editor, since many ide use Ctrl+Space as default key binding for Completion.<br />
<br />
=== All Gtk Apps have problem? === <!--T:62--><br />
* Please open a traditional Gtk App (traditional Gtk App means, it cannot be Firefox, Libreoffice, which only use Gtk as a UI style). Gedit is a good choice. Right click at the input box, there will be a menu named "Input Method", please make sure there is "Fcitx" in it and being choosed.<br />
<br />
<!--T:63--><br />
* If there is "Fcitx", but it still not works. Please try to restart Fcitx, if it will works at this time, please check your DBus settings, or make Fcitx start later. You can read [[Special:MyLanguage/Configure (Other)|Configure (Other)]] if you're using a custom startup script.<br />
<br />
<!--T:64--><br />
* If there is Fcitx but not being choosed by default, and please select it and you can immediately try again in this app. If not works, please read the entry above. For permanent fix (To use Fcitx by default), please read Configure part in [[Special:MyLanguage/Install And Configure|Install And Configure]].<br />
<br />
<!--T:65--><br />
* If there is no Fcitx, you should check your install first. Usually, the package name contains fcitx and gtk. If you [[Special:MyLanguage/Compile from source|compile fcitx from source]], please make sure you have enable GTK{2,3}_IM_MODULE option. If you're sure about this, please read [[Special:MyLanguage/Input method related environment variables|Input method related environment variables]] for how to update some cached file for gtk.<br />
<br />
<!--T:38--><br />
* If you are using Ubuntu and upgrade to 12.04 recently, or something werid happens to your system (Due to packager careless, or buggy package manager which can not do upgrade in correct order, for example, [https://bugs.archlinux.org/task/32764 pacman]), you might notice that gtk.immodules related files doesn't generate correctly during upgrade. Try uninstall {{package ubuntu|fcitx-frontend-gtk2}}, {{package ubuntu|fcitx-frontend-gtk3}} or coressponding package on your system and re-install them to trigger the file generate. Then recheck the input method menu to see whether it have "Fcitx" in the menu or not.<br />
<br />
=== All Qt Apps have problem? === <!--T:66--><br />
* Run qtconfig (might have different name on your distribution, it might be qtconfig-qt4), and go to the third tab, make sure fcitx is in the "Default Input Method" combo-box. If not, please check your install.<br />
* Above solution can also applies if you want use XIM, but still we highly recommend you to use im module. See Also [[Special:MyLanguage/Input method related environment variables|Input method related environment variables]].<br />
<br />
==== Telegram desktop ==== <!--T:77--><br />
Some distribution enables Qt6 for telegram desktop. Just make sure you have the Qt6 im module (For fcitx4, it's fcitx-qt6 on archlinux).<br />
<br />
=== Chromium or any other chromium based browser (E.g. Microsoft Edge) ===<br />
For Chromium running under X11, if you are using startx to start your graphical user interface, you may hit [https://gitlab.freedesktop.org/xorg/app/xinit/-/issues/9 an issue] in startx that unset the DBUS_SESSION_BUS_ADDRESS, which prevent chromium based browser from using dbus correctly. To mitigate this, you may:<br />
<br />
1. either export DBUS_SESSION_BUS_ADDRESS by yourself in your ~/.xinitrc (or simply change to use ~/.xsession if you are using debian based system).<br />
<br />
2. or use a display manager like sddm, gdm, lightdm instead of startx.<br />
<br />
For Chromium that runs natively under wayland, the only native wayland input method protocol it supports is text-input-v1, which is only supported by weston. Alternatively, it can also use Gtk4's im module, you can use following flag (---enable-features=UseOzonePlatform --ozone-platform=wayland --gtk-version=4) to make it use Gtk im module, but it doesn't fully work in terms of popup window position unless you are using kimpanel + GNOME.<br />
<br />
=== Is it Java, Xterm, wine, or some other non-Gtk/Qt Application? === <!--T:39--><br />
There are also some very rare case, that you're using a embedded linux or mini-linux distro, in which you must use XIM, the X server might missing some locale file. The file is usually needed to be under /usr/share/X11/locale/.<br />
<br />
<!--T:40--><br />
And When you must use XIM, please make sure, your locale '''must NOT''' be C or POSIX and need to be a valid locale (no matter which language), and need to be generated if you are using glibc (locale-gen). When you are using im module, there is no such limitation.<br />
<br />
=== Is it a Qt application that bundles its own Qt library? === <!--T:74--><br />
Bundled Qt library usually uses theirs own plugin directory, which is different from system's Qt. And commonly, they are also using Qt different on system Qt, which will also make it incompatible if you simply copy the system fcitx-qt files. But anyway, you can start to check whether it loads your copied files with following environment variable. Depending on how the XIM application is written, it may need to find specific font to make it work. On Archlinux xorg-mkfontscale is required to generate correct font dir files. After install it, you'll need to restart X Server to make it work.<br />
<br />
<!--T:75--><br />
QT_DEBUG_PLUGINS=1 QT_LOGGING_RULES="*.debug=true"<br />
<br />
<!--T:76--><br />
And try to resolve all incompatible errors. Usually, ubuntu's fcitx-frontend-qt5 and libfcitxqt5-1 are good source for fcitx-qt5 build against specific qt version. For example, DraftSight 2017S0 [https://groups.google.com/forum/#!topic/fcitx/9e4TI39_4sk] may work with xenial's fcitx-qt5.<br />
<br />
=== Emacs === <!--T:67--><br />
Try<br />
<br />
<!--T:68--><br />
LC_CTYPE=zh_CN.UTF-8 emacs<br />
<br />
<!--T:69--><br />
Don't forget to check your locale -a contains that. See also [[Special:MyLanguage/Input method related environment variables|Input method related environment variables]].<br />
<br />
<!--T:70--><br />
Emacs will use `-*-*-*-r-normal--<some font size>-*-*-*-*-*-*-*' as basefont(in src/xfns.c), if you do not have one matched, the code for input method won't run. Install some font package may help (For required fonts xorg-fonts-misc might be the right package but you can also try other xorg-fonts-* package.). <br />
<br />
=== Non Gtk/Qt Wayland Application (Alacritty, kitty, etc) === <!--T:78--><br />
It is possible that the application you use does not support input method at all, because they need to have relevant code to implement it. Even if they do, it is highly possible that compositor does not have the support for input method. Only GNOME Shell and KWin has full text-input-v3 support. As of 2022/05/07, sway still does not have full zwp_input_method_v2 support to support input surface. For KWin, you will need Plasma 5.24+ and Fcitx 5.0.14+ and make KWin to start Fcitx 5. You will need to go to Virtual Keyboard KCM and select Fcitx 5 in the KCM.<br />
<br />
== Candidate window is blinking under wayland with Fcitx 5 == <!--T:79--><br />
This is mainly due to the whole poor state of wayland input method. The existing wayland input method protocol is not widely supported by compositor. Even though fcitx 5 support those protocols, the poor support in application and compositor make them not usable. Not to mention certain design flaw within the protocol.<br />
<br />
<!--T:80--><br />
In order to make input method some what usable with '''CURRENTLY''' available and widely adopted techniques, Fcitx 5 implements a mechanism called "Client Side Input Panel", which basically asks client application to render the input window. This is done through dbus and IM Module for Gtk/Qt. The implementation requires using a underlying wayland protocol xdg_popup to show the window. Unfortunately, only new version of xdg_popup protocol supports '''moving''' a visible popup window, and this part is '''NOT''' implemented in Gtk3 and Qt5. What makes it even worse is that Gtk3 and Qt5 both comes to their end of life, which means it is not possible to get this new protocol support in Gtk3/Qt5. The issue is that input method requires to display a window that resizes and moves extremely frequently. To mitigate this issue, Fcitx 5 IM Module implement a hack that when we need to move the window, it will hide the window first and then show the window. Unfortunately, this would cause certain-level of blinking. It might looks bad in certain hardware and compositor combination.<br />
<br />
<!--T:81--><br />
Here is some possible workaround for this.<br />
<br />
<!--T:82--><br />
1. Use kimpanel under GNOME shell, which will make the candidate window to be rendered with a totally different mechanism, which won't cause any blinking. <br />
<br />
<!--T:83--><br />
2. Disable Fade-in and Fade-Out effect under KWin. KWin seems to tolerate such blink much better than certain compositor.<br />
<br />
== Problem in Firefox and Google Docs == <!--T:4--><br />
<br />
<!--T:41--><br />
You might want to toggle preedit off temporarily, which is Ctrl+Alt+P.<br />
<br />
== Cannot use Fcitx in flash == <!--T:5--><br />
<br />
<!--T:42--><br />
Please read [[Special:MyLanguage/Hall of Shame for Linux IME Support|Hall of Shame for Linux IME Support]], and use im module.<br />
<br />
== Cannot type English after updating to fcitx newer than 4.2.4 == <!--T:6--><br />
<br />
<!--T:43--><br />
Make sure you have add "[[Special:myLanguage/Keyboard|Keyboard]]" to the input method list. You can use [[Special:myLanguage/Integrate with Desktop#Configuration tool|Configuration tool]].<br />
<br />
<!--T:44--><br />
And you may want to move "Keyboard" to the first one.<br />
<br />
== Unexpected keyboard layout change == <!--T:7--><br />
<br />
<!--T:45--><br />
Use [[Special:myLanguage/Integrate with Desktop#Configuration tool|Configuration tool]], to bind specific keyboard layout to the specific input method.<br />
<br />
== xmodmap settings being overwritten == <!--T:8--><br />
<br />
<!--T:46--><br />
Fcitx now control keyboard layout and when switch layout, xmodmap setting will be overwritten. So fcitx-xkb provides an option to specify the xmodmap script and let fcitx loads it for you whenever keyboard layout changes. Or disable fcitx-xkb addon is also a solution for you, or if your requirement is simply, for example, switching Caps Lock and Esc, which is provided by xkb option, you can just set it with your desktop keyboard configuration tool (Gnome and KDE all support such configuration).<br />
<br />
<!--T:47--><br />
For more detailed explanation, xmodmap is a very low level tool, that doesn't aware keyboard layout. For X11, keyboard layout is built on a set of profile, when such profile is loaded, anything you changed with xmodmap will be overwritten, this isn't specific to fcitx, but all tool that support keyboard layout configuration. Xkb option is a set of profile that can do some pre-defined change over keyboard layout, including many thing that people usually do with xmodmap, for example, defining where dead key is, switching Caps Lock and Esc, and so on. Unless you have special requirements, xkb layout and xkb option is recommended.<br />
<br />
<!--T:71--><br />
Since 4.2.7, Fcitx will try to load ~/.Xmodmap if it exists.<br />
<br />
== Configure user interface, font, vertical list == <!--T:9--><br />
<br />
<!--T:48--><br />
Use [[Special:myLanguage/Integrate with Desktop#Configuration tool|Configuration tool]], Addon Configuration -> Classic UI.<br />
<br />
<!--T:49--><br />
If you are using [[Special:myLanguage/Configtool|fcitx-configtool]] newer than 0.4.5 or [[Special:myLanguage/Kcm|kcm-fcitx]] newer 0.4.1, you can directly configure those from the first level tab.<br />
<br />
== Possible issue for GNOME 3.6 == <!--T:10--><br />
<br />
<!--T:50--><br />
[[Note for GNOME Later than 3.6]]<br />
<br />
== [[Special:MyLanguage/ClassicUI|Classic UI]] is not transparent == <!--T:11--><br />
<br />
* This problem might NOT exist any more since 4.2.6 with a different approach for detect composite manager.<br />
* Restart Fcitx first, if it's ok then, it might be a bug in your Window manager. Gnome-Shell, xcompmgr is known to have this bug. You can try to set the delay start to walkaround this problem.<br />
* If restart Fcitx doesn't solve this problem, you should check whether your window manager supports composite or it's enabled or not.<br />
=== Kwin === <!--T:51--><br />
<br />
Enable desktop effects.<br />
=== Metacity before GNOME3 === <!--T:52--><br />
<br />
gconftool-2 -s --type bool /apps/metacity/general/compositing_manager true<br />
=== Xfce === <!--T:53--><br />
<br />
Xfwm support composite, but need to be enabled by hand.<br />
=== Compiz === <!--T:54--><br />
<br />
0.9 series compiz can disable composite. You can use ccsm to configure it.<br />
=== Other window manager === <!--T:55--><br />
<br />
<!--T:56--><br />
You can use xcompmgr, cairo-compmgr as composite manager for them.<br />
<br />
== Minecraft == <!--T:12--><br />
<br />
<!--T:34--><br />
Original Minecraft under linux doesn't support input method, what make it worse is, XIM will conflict with its key event processing, one way to work around is, set a wrong environment variable on purpose for minecraft, then start up it. You can use following script to do that<br />
<br />
<!--T:35--><br />
<pre>#!/bin/sh<br />
# set a wrong one<br />
export XMODIFIERS="@im=null"<br />
# start minecraft, this might change depends on you're mod, but simply its what you ARE using to start minecraft.<br />
java -Xmx1024M -Xms512M -cp minecraft.jar net.minecraft.LauncherFrame</pre><br />
<br />
<!--T:58--><br />
This way can be also used, if you don't want fcitx to work on some application which is using XIM.<br />
<br />
<!--T:73--><br />
There is a mod can be used to support input under Linux, called [http://forum.minecraftuser.jp/viewtopic.php?t=6279 NihongoMOD], 1.2.2 with minecraft 1.5.2 can work with Fcitx without upper hack.<br />
<br />
== Root application under normal user X == <!--T:57--><br />
Root application under X normal user session is always broken (in general, not specific to fcitx), due to the fact that dbus is a user session only process. The only way to type in root application with normal fcitx is to use XIM, set GTK_IM_MODULE=xim and QT_IM_MODULE=xim before you start your application.<br />
<br />
== Cursor Following problem == <!--T:13--><br />
There is a common misunderstanding that it's input method's fault that input window could not follow the cursor, which is simply wrong. This is how cursor following works: Application send the position to Input method, then input method move the input window. So if application do not send the position, the position would be wrong. This behavior is controlled by application, but not input method. So if you meet any problem, please ask application to fix it, don't ask input method to do anything. Actually, input method could do nothing with this.<br />
<br />
<!--T:59--><br />
Although there is some walkaround for specific problem, bug is still in application, not in input method.<br />
<br />
<!--T:60--><br />
* Opera, enable on the spot for [[Special:MyLanguage/XIM|XIM]].<br />
* Firefox, enable preedit.<br />
<br />
<!--T:14--><br />
[[Category:How-to]]<br />
<br />
</translate></div>Weng Xuetianhttps://fcitx-im.org/index.php?title=FAQ&diff=45429FAQ2023-02-26T04:49:22Z<p>Weng Xuetian: </p>
<hr />
<div><languages/><br />
<translate><br />
<br />
<!--T:1--><br />
When you want to complain about input method cannot work correctly, please read this first.<br />
<br />
<!--T:72--><br />
Since 4.2.7, fcitx provides a command called fcitx-diagnose, it will try to detect some common problem and give some advice.<br />
<br />
<!--T:2--><br />
[[Special:MyLanguage/Hall of Shame for Linux IME Support|Hall of Shame for Linux IME Support]]<br />
<br />
== When use Ctrl + Space, Fcitx cannot be triggered on == <!--T:3--><br />
<br />
=== Wayland ===<br />
See [[Special:MyLanguage/Using Fcitx 5 on Wayland|Using Fcitx 5 on Wayland]].<br />
<br />
<!--T:37--><br />
Check the application you want to type.<br />
<br />
=== Only one specific app has problem? === <!--T:61--><br />
* The most possible reason for this is Ctrl+Space occupied by some hotkey, please change to another trigger key and try again. This usually happens in some editor, since many ide use Ctrl+Space as default key binding for Completion.<br />
<br />
=== All Gtk Apps have problem? === <!--T:62--><br />
* Please open a traditional Gtk App (traditional Gtk App means, it cannot be Firefox, Libreoffice, which only use Gtk as a UI style). Gedit is a good choice. Right click at the input box, there will be a menu named "Input Method", please make sure there is "Fcitx" in it and being choosed.<br />
<br />
<!--T:63--><br />
* If there is "Fcitx", but it still not works. Please try to restart Fcitx, if it will works at this time, please check your DBus settings, or make Fcitx start later. You can read [[Special:MyLanguage/Configure (Other)|Configure (Other)]] if you're using a custom startup script.<br />
<br />
<!--T:64--><br />
* If there is Fcitx but not being choosed by default, and please select it and you can immediately try again in this app. If not works, please read the entry above. For permanent fix (To use Fcitx by default), please read Configure part in [[Special:MyLanguage/Install And Configure|Install And Configure]].<br />
<br />
<!--T:65--><br />
* If there is no Fcitx, you should check your install first. Usually, the package name contains fcitx and gtk. If you [[Special:MyLanguage/Compile from source|compile fcitx from source]], please make sure you have enable GTK{2,3}_IM_MODULE option. If you're sure about this, please read [[Special:MyLanguage/Input method related environment variables|Input method related environment variables]] for how to update some cached file for gtk.<br />
<br />
<!--T:38--><br />
* If you are using Ubuntu and upgrade to 12.04 recently, or something werid happens to your system (Due to packager careless, or buggy package manager which can not do upgrade in correct order, for example, [https://bugs.archlinux.org/task/32764 pacman]), you might notice that gtk.immodules related files doesn't generate correctly during upgrade. Try uninstall {{package ubuntu|fcitx-frontend-gtk2}}, {{package ubuntu|fcitx-frontend-gtk3}} or coressponding package on your system and re-install them to trigger the file generate. Then recheck the input method menu to see whether it have "Fcitx" in the menu or not.<br />
<br />
=== All Qt Apps have problem? === <!--T:66--><br />
* Run qtconfig (might have different name on your distribution, it might be qtconfig-qt4), and go to the third tab, make sure fcitx is in the "Default Input Method" combo-box. If not, please check your install.<br />
* Above solution can also applies if you want use XIM, but still we highly recommend you to use im module. See Also [[Special:MyLanguage/Input method related environment variables|Input method related environment variables]].<br />
<br />
==== Telegram desktop ==== <!--T:77--><br />
Some distribution enables Qt6 for telegram desktop. Just make sure you have the Qt6 im module (For fcitx4, it's fcitx-qt6 on archlinux).<br />
<br />
=== Chromium or any other chromium based browser (E.g. Microsoft Edge) ===<br />
For Chromium running under X11, if you are using startx to start your graphical user interface, you may hit [https://gitlab.freedesktop.org/xorg/app/xinit/-/issues/9 an issue] in startx that unset the DBUS_SESSION_BUS_ADDRESS, which prevent chromium based browser from using dbus correctly. To mitigate this, you may:<br />
<br />
1. either export DBUS_SESSION_BUS_ADDRESS by yourself in your ~/.xinitrc (or simply change to use ~/.xsession if you are using debian based system).<br />
<br />
2. or use a display manager like sddm, gdm, lightdm instead of startx.<br />
<br />
For Chromium that runs natively under wayland, the only native wayland input method protocol it supports is text-input-v1, which is only supported by weston. Alternatively, it can also use Gtk4's im module, you can use following flag (---enable-features=UseOzonePlatform --ozone-platform=wayland --gtk_version=4) to make it use Gtk im module, but it doesn't fully work in terms of popup window position unless you are using kimpanel + GNOME.<br />
<br />
=== Is it Java, Xterm, wine, or some other non-Gtk/Qt Application? === <!--T:39--><br />
There are also some very rare case, that you're using a embedded linux or mini-linux distro, in which you must use XIM, the X server might missing some locale file. The file is usually needed to be under /usr/share/X11/locale/.<br />
<br />
<!--T:40--><br />
And When you must use XIM, please make sure, your locale '''must NOT''' be C or POSIX and need to be a valid locale (no matter which language), and need to be generated if you are using glibc (locale-gen). When you are using im module, there is no such limitation.<br />
<br />
=== Is it a Qt application that bundles its own Qt library? === <!--T:74--><br />
Bundled Qt library usually uses theirs own plugin directory, which is different from system's Qt. And commonly, they are also using Qt different on system Qt, which will also make it incompatible if you simply copy the system fcitx-qt files. But anyway, you can start to check whether it loads your copied files with following environment variable. Depending on how the XIM application is written, it may need to find specific font to make it work. On Archlinux xorg-mkfontscale is required to generate correct font dir files. After install it, you'll need to restart X Server to make it work.<br />
<br />
<!--T:75--><br />
QT_DEBUG_PLUGINS=1 QT_LOGGING_RULES="*.debug=true"<br />
<br />
<!--T:76--><br />
And try to resolve all incompatible errors. Usually, ubuntu's fcitx-frontend-qt5 and libfcitxqt5-1 are good source for fcitx-qt5 build against specific qt version. For example, DraftSight 2017S0 [https://groups.google.com/forum/#!topic/fcitx/9e4TI39_4sk] may work with xenial's fcitx-qt5.<br />
<br />
=== Emacs === <!--T:67--><br />
Try<br />
<br />
<!--T:68--><br />
LC_CTYPE=zh_CN.UTF-8 emacs<br />
<br />
<!--T:69--><br />
Don't forget to check your locale -a contains that. See also [[Special:MyLanguage/Input method related environment variables|Input method related environment variables]].<br />
<br />
<!--T:70--><br />
Emacs will use `-*-*-*-r-normal--<some font size>-*-*-*-*-*-*-*' as basefont(in src/xfns.c), if you do not have one matched, the code for input method won't run. Install some font package may help (For required fonts xorg-fonts-misc might be the right package but you can also try other xorg-fonts-* package.). <br />
<br />
=== Non Gtk/Qt Wayland Application (Alacritty, kitty, etc) === <!--T:78--><br />
It is possible that the application you use does not support input method at all, because they need to have relevant code to implement it. Even if they do, it is highly possible that compositor does not have the support for input method. Only GNOME Shell and KWin has full text-input-v3 support. As of 2022/05/07, sway still does not have full zwp_input_method_v2 support to support input surface. For KWin, you will need Plasma 5.24+ and Fcitx 5.0.14+ and make KWin to start Fcitx 5. You will need to go to Virtual Keyboard KCM and select Fcitx 5 in the KCM.<br />
<br />
== Candidate window is blinking under wayland with Fcitx 5 == <!--T:79--><br />
This is mainly due to the whole poor state of wayland input method. The existing wayland input method protocol is not widely supported by compositor. Even though fcitx 5 support those protocols, the poor support in application and compositor make them not usable. Not to mention certain design flaw within the protocol.<br />
<br />
<!--T:80--><br />
In order to make input method some what usable with '''CURRENTLY''' available and widely adopted techniques, Fcitx 5 implements a mechanism called "Client Side Input Panel", which basically asks client application to render the input window. This is done through dbus and IM Module for Gtk/Qt. The implementation requires using a underlying wayland protocol xdg_popup to show the window. Unfortunately, only new version of xdg_popup protocol supports '''moving''' a visible popup window, and this part is '''NOT''' implemented in Gtk3 and Qt5. What makes it even worse is that Gtk3 and Qt5 both comes to their end of life, which means it is not possible to get this new protocol support in Gtk3/Qt5. The issue is that input method requires to display a window that resizes and moves extremely frequently. To mitigate this issue, Fcitx 5 IM Module implement a hack that when we need to move the window, it will hide the window first and then show the window. Unfortunately, this would cause certain-level of blinking. It might looks bad in certain hardware and compositor combination.<br />
<br />
<!--T:81--><br />
Here is some possible workaround for this.<br />
<br />
<!--T:82--><br />
1. Use kimpanel under GNOME shell, which will make the candidate window to be rendered with a totally different mechanism, which won't cause any blinking. <br />
<br />
<!--T:83--><br />
2. Disable Fade-in and Fade-Out effect under KWin. KWin seems to tolerate such blink much better than certain compositor.<br />
<br />
== Problem in Firefox and Google Docs == <!--T:4--><br />
<br />
<!--T:41--><br />
You might want to toggle preedit off temporarily, which is Ctrl+Alt+P.<br />
<br />
== Cannot use Fcitx in flash == <!--T:5--><br />
<br />
<!--T:42--><br />
Please read [[Special:MyLanguage/Hall of Shame for Linux IME Support|Hall of Shame for Linux IME Support]], and use im module.<br />
<br />
== Cannot type English after updating to fcitx newer than 4.2.4 == <!--T:6--><br />
<br />
<!--T:43--><br />
Make sure you have add "[[Special:myLanguage/Keyboard|Keyboard]]" to the input method list. You can use [[Special:myLanguage/Integrate with Desktop#Configuration tool|Configuration tool]].<br />
<br />
<!--T:44--><br />
And you may want to move "Keyboard" to the first one.<br />
<br />
== Unexpected keyboard layout change == <!--T:7--><br />
<br />
<!--T:45--><br />
Use [[Special:myLanguage/Integrate with Desktop#Configuration tool|Configuration tool]], to bind specific keyboard layout to the specific input method.<br />
<br />
== xmodmap settings being overwritten == <!--T:8--><br />
<br />
<!--T:46--><br />
Fcitx now control keyboard layout and when switch layout, xmodmap setting will be overwritten. So fcitx-xkb provides an option to specify the xmodmap script and let fcitx loads it for you whenever keyboard layout changes. Or disable fcitx-xkb addon is also a solution for you, or if your requirement is simply, for example, switching Caps Lock and Esc, which is provided by xkb option, you can just set it with your desktop keyboard configuration tool (Gnome and KDE all support such configuration).<br />
<br />
<!--T:47--><br />
For more detailed explanation, xmodmap is a very low level tool, that doesn't aware keyboard layout. For X11, keyboard layout is built on a set of profile, when such profile is loaded, anything you changed with xmodmap will be overwritten, this isn't specific to fcitx, but all tool that support keyboard layout configuration. Xkb option is a set of profile that can do some pre-defined change over keyboard layout, including many thing that people usually do with xmodmap, for example, defining where dead key is, switching Caps Lock and Esc, and so on. Unless you have special requirements, xkb layout and xkb option is recommended.<br />
<br />
<!--T:71--><br />
Since 4.2.7, Fcitx will try to load ~/.Xmodmap if it exists.<br />
<br />
== Configure user interface, font, vertical list == <!--T:9--><br />
<br />
<!--T:48--><br />
Use [[Special:myLanguage/Integrate with Desktop#Configuration tool|Configuration tool]], Addon Configuration -> Classic UI.<br />
<br />
<!--T:49--><br />
If you are using [[Special:myLanguage/Configtool|fcitx-configtool]] newer than 0.4.5 or [[Special:myLanguage/Kcm|kcm-fcitx]] newer 0.4.1, you can directly configure those from the first level tab.<br />
<br />
== Possible issue for GNOME 3.6 == <!--T:10--><br />
<br />
<!--T:50--><br />
[[Note for GNOME Later than 3.6]]<br />
<br />
== [[Special:MyLanguage/ClassicUI|Classic UI]] is not transparent == <!--T:11--><br />
<br />
* This problem might NOT exist any more since 4.2.6 with a different approach for detect composite manager.<br />
* Restart Fcitx first, if it's ok then, it might be a bug in your Window manager. Gnome-Shell, xcompmgr is known to have this bug. You can try to set the delay start to walkaround this problem.<br />
* If restart Fcitx doesn't solve this problem, you should check whether your window manager supports composite or it's enabled or not.<br />
=== Kwin === <!--T:51--><br />
<br />
Enable desktop effects.<br />
=== Metacity before GNOME3 === <!--T:52--><br />
<br />
gconftool-2 -s --type bool /apps/metacity/general/compositing_manager true<br />
=== Xfce === <!--T:53--><br />
<br />
Xfwm support composite, but need to be enabled by hand.<br />
=== Compiz === <!--T:54--><br />
<br />
0.9 series compiz can disable composite. You can use ccsm to configure it.<br />
=== Other window manager === <!--T:55--><br />
<br />
<!--T:56--><br />
You can use xcompmgr, cairo-compmgr as composite manager for them.<br />
<br />
== Minecraft == <!--T:12--><br />
<br />
<!--T:34--><br />
Original Minecraft under linux doesn't support input method, what make it worse is, XIM will conflict with its key event processing, one way to work around is, set a wrong environment variable on purpose for minecraft, then start up it. You can use following script to do that<br />
<br />
<!--T:35--><br />
<pre>#!/bin/sh<br />
# set a wrong one<br />
export XMODIFIERS="@im=null"<br />
# start minecraft, this might change depends on you're mod, but simply its what you ARE using to start minecraft.<br />
java -Xmx1024M -Xms512M -cp minecraft.jar net.minecraft.LauncherFrame</pre><br />
<br />
<!--T:58--><br />
This way can be also used, if you don't want fcitx to work on some application which is using XIM.<br />
<br />
<!--T:73--><br />
There is a mod can be used to support input under Linux, called [http://forum.minecraftuser.jp/viewtopic.php?t=6279 NihongoMOD], 1.2.2 with minecraft 1.5.2 can work with Fcitx without upper hack.<br />
<br />
== Root application under normal user X == <!--T:57--><br />
Root application under X normal user session is always broken (in general, not specific to fcitx), due to the fact that dbus is a user session only process. The only way to type in root application with normal fcitx is to use XIM, set GTK_IM_MODULE=xim and QT_IM_MODULE=xim before you start your application.<br />
<br />
== Cursor Following problem == <!--T:13--><br />
There is a common misunderstanding that it's input method's fault that input window could not follow the cursor, which is simply wrong. This is how cursor following works: Application send the position to Input method, then input method move the input window. So if application do not send the position, the position would be wrong. This behavior is controlled by application, but not input method. So if you meet any problem, please ask application to fix it, don't ask input method to do anything. Actually, input method could do nothing with this.<br />
<br />
<!--T:59--><br />
Although there is some walkaround for specific problem, bug is still in application, not in input method.<br />
<br />
<!--T:60--><br />
* Opera, enable on the spot for [[Special:MyLanguage/XIM|XIM]].<br />
* Firefox, enable preedit.<br />
<br />
<!--T:14--><br />
[[Category:How-to]]<br />
<br />
</translate></div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Using_Fcitx_5_on_Wayland&diff=45428Using Fcitx 5 on Wayland2023-02-26T04:47:06Z<p>Weng Xuetian: /* Chromium / Electron */</p>
<hr />
<div>[https://wayland.freedesktop.org/ Wayland] is the next generation of display server protocol. While the initial release of the protocol is in 2008, the support of input method is not really ideal.<br />
<br />
Also, using input method on Wayland-based compositor may require different setup to make it work, and certain features of fcitx that works under X11 are not yet supported by Wayland.<br />
<br />
This page will try to cover all the current information with some underlying details, and [[Special:MyLanguage/Setup Fcitx 5|Setup Fcitx 5]] is still generally useful.<br />
<br />
== Applications ==<br />
=== Legacy X11 application that runs under XWayland ===<br />
In a word, XWayland support for input method is as good as normal X11 display server. As long as you set the same environment variable, using Xwayland should not be a issue. This category includes: <br />
<br />
* Xlib-based (and also other toolkit based on Xlib, e.g. tk, SDL1, etc), e.g. xterm, rxvt. Make sure XMODIFIERS is set correctly.<br />
* Gtk2-based applications, similar to Xlib, but can use fcitx im module. Set GTK_IM_MODULE to fcitx will give it best experience.<br />
* SDL2-based applications that doesn't default to wayland. Set SDL_IM_MODULE to fcitx<br />
* electron, chromium, these are still default to X11, similar to Gtk2 case.<br />
* For Qt4 applcation, Qt 4 can only use X11. You will need to QT_IM_MODULE to fcitx. Same for Qt5+ that uses XCB (can be override with QT_QPA_PLATFORM=xcb).<br />
<br />
=== Gtk3 / Gtk4 ===<br />
Gtk3 and Gtk4 support text-input-v3 natively. At the same time, it's also possible to use fcitx im module under wayland. So, either GTK_IM_MODULE=wayland or GTK_IM_MODULE=fcitx works. There are some difference to it. text-input-v3<br />
<br />
=== Qt5 / Qt6 ===<br />
If your Qt application natively runs under Wayland, you can either unset QT_IM_MODULE to make it use text-input-v2, or set QT_IM_MODULE=fcitx to make it use fcitx im module.<br />
<br />
text-input-v2 is not upstreamed to wayland-protocols, that is probably why only kwin support it. This means in non-kwin environment, you will need to use QT_IM_MODULE=fcitx to make the Qt applications work.<br />
<br />
On Qt6, you may also use QT_IM_MODULE= (empty) or QT_IM_MODULE=wayland if your Qt vesion contains this https://codereview.qt-project.org/c/qt/qtwayland/+/416862.<br />
<br />
=== Native wayland application (winit) ===<br />
Most likely text-input-v3 is being used.<br />
<br />
=== Chromium / Electron ===<br />
{{warning|The information in this section may not be up to date to reflect upstream change, especially the default behavior when no option is changed.}}<br />
You may force it to run with Wayland, or X11 with the flag <code>--ozone-platform=wayland</code> and <code>--ozone-platform=x11</code>. You may persistent this by changing the option "Preferred Ozone Platform" in chrome://flags. It has four values, "Default", "X11", "Wayland", "Auto".<br />
<br />
By default it should run under Xwayland (As of 2023/02/25 on Archlinux/Chromium 110.0.5481.177), but some user also reports it is using wayland even the "Preferred Ozone Platform" is "Default". So to check whether it's really run with wayland, you can use xeyes or xwininfo. With xeyes, if it's an X11 window, the "eyes" will move with mouse, otherwise it's wayland. With xwininfo, if the mouse cursor changed to "+" shape, and click the window shows the window information, then it is a X11 window.<br />
<br />
It's possible to make it use GTK_IM_MODULE if it runs with Gtk4 (only supported by chromium/chrome at this time, not electron) by passing <code>--gtk-version=4</code>.<br />
<br />
It's also possible to make it use text-input-v1 by passing <code>--enable-wayland-ime</code> in addition to the flag above.<br />
<br />
You should only use one of <code>--enable-wayland-ime</code> or <code>--gtk-version=4</code>, depending on you want to use text-input-v1, or gtk4 im module. text-input-v1 works for kwin 5.27 and weston. Gtk4 im module works on all environment, but only GNOME with Kimpanel extension can display the popup window in the correct position.<br />
<br />
== Desktop environment ==<br />
<br />
Even if you are using only native wayland applications, Xwayland is recommended to be enabled for following reason. If client side input panel in im module does not work, fcitx will fallback to a X11 window, instead of a wayland window. The reason for this is because wayland window can not be placed freely on the screen. On the contrary, even if im module can only pass a coordinate relative to the application window to fcitx, which make the coordinate position doesn't make much sense, if your application window size is "maximized", the coordinate may just be "right" if treated as the global coordinate. This makes X11 window a better option than a randomly placed wayland window.<br />
<br />
=== KDE Plasma ===<br />
* App/Compositor supports text-input-v2 and text-input-v3.<br />
* Comopositor/Application uses zwp_input_method_v1. <br />
* 5.27 additionally supports text-input-v1.<br />
* 5.24 usable zwp_input_method_v1 with fcitx5. Pre-5.24 there are lots of problems, always use fcitx im module instead.<br />
* Use "Virtual keyboard" KCM to launch fcitx5. This is required to use text-input protocol. If you launch fcitx this way, make sure you do not use "restart" in the tray menu, since the socket passed from KWin can not be reused with the newly restarted fcitx.<br />
<br />
=== GNOME ===<br />
* Application/Compositor uses text-input-v3<br />
* Compositor/Input Method uses ibus dbus protocol, so ibus frontend is required to be used.<br />
* Adding Fcitx 5 to autostart, it will replace any existing ibus-daemon upon start up so it will work out of box.<br />
* Popup candidate window is not able to be displayed over gnome-shell UI. Only solution is to use [[Special:MyLanguage/Kimpanel|Kimpanel]], [https://extensions.gnome.org/extension/261/kimpanel/ link to extension].<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Sway ===<br />
* Application/Compositor uses text-input-v3<br />
* Comopositor/Application uses zwp_input_method_v2, but it's partially implemented. You will need [https://github.com/swaywm/sway/pull/7226 this pull request] to make it show the popup candidate window for text-input-v3 client.<br />
* fcitx im module also works.<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Weston ===<br />
* Application/Compositor uses text-input-v1<br />
* Comopositor/Application uses zwp_input_method_v1.<br />
* Since it has no text-input-v3, which is more commonly used, im module is the only solution for Gtk/Qt, need to set GTK_IM_MODULE=fcitx and QT_IM_MODULE=fcitx.<br />
* Add following content to ~/.config/weston.ini to make it launch fcitx 5. (xwayland part is recommended to make fcitx work best, even if it's wayland)<br />
<br />
<pre><br />
[core]<br />
xwayland=true<br />
<br />
[input-method]<br />
path=/usr/bin/fcitx5<br />
</pre><br />
<br />
=== Other compositors ===<br />
Please check their upstream for more information. For wlroots based compositors, it is possible that they also support in the same way as Sway does, or zwp_input_method could also be unsupported.<br />
<br />
== Known Issues ==<br />
=== Fcitx managed XKB layout ===<br />
Unlike X11, there is no generic way to set XKB layout to compositor, which means it can only be implemented for every individual desktop. Right now, Fcitx managed layout only works for KDE Plasma.<br />
<br />
As for non-KDE desktop, in order to make this "semi" work you'll need to ensure following:<br />
<br />
* The system layout in the group should be the same as the actual xkb layout you configured for the compositor.<br />
* Configure only one layout.<br />
* If you need other layout for text typing (e.g. Arabic), just add them to the Fcitx. As long as the key is forwarded to fcitx, it should work.<br />
<br />
=== Popup candidate window ===<br />
Wayland does not have a global coordinate system for regular client, so for native wayland client, it is impossible for Fcitx to place a wayland surface at a certain position. In order for popup window to be placed at the correct position, there are following cases:<br />
* Xwayland have no problem and it should work as good as X11.<br />
* If zwp_input_method protocol can be used, it has a surface role to allow compositor to place the popup window for input method. This only works if client uses text-input protocol.<br />
* For GNOME, kimpanel extension can read window coordinate since it's running inside compositor. As long as im module can report relative coordinate, kimpanel extension can display the popup window at the correct position. As similar approach for Plasma kimpanel is planned, but not yet implemented.<br />
* For Gtk/Qt, fcitx's im module implement a way to render the popup with in the client process. This has some limitation because implemenation of xdg_popup in Gtk3/Qt5 doesn't support reposition the window. So show/hide trick is used to mitigate this, but it may cause window blinking. Fcitx tries not to move window if possible. You may also disable popup animation if you're using KWin to help reduce the blinking.<br />
<br />
=== Per-window input method state ===<br />
When zwp_input_method is used, essentially there is only one input context visible to fcitx, and fcitx cannot distinguish what application is being used. Which means the input method "active"/"inactivate" state is now "global".<br />
<br />
There is planned change to obtain the active application name and use "virtual" input context for wayland frontend. It's not yet in the stable version of Fcitx.</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Using_Fcitx_5_on_Wayland&diff=45427Using Fcitx 5 on Wayland2023-02-26T04:46:56Z<p>Weng Xuetian: </p>
<hr />
<div>[https://wayland.freedesktop.org/ Wayland] is the next generation of display server protocol. While the initial release of the protocol is in 2008, the support of input method is not really ideal.<br />
<br />
Also, using input method on Wayland-based compositor may require different setup to make it work, and certain features of fcitx that works under X11 are not yet supported by Wayland.<br />
<br />
This page will try to cover all the current information with some underlying details, and [[Special:MyLanguage/Setup Fcitx 5|Setup Fcitx 5]] is still generally useful.<br />
<br />
== Applications ==<br />
=== Legacy X11 application that runs under XWayland ===<br />
In a word, XWayland support for input method is as good as normal X11 display server. As long as you set the same environment variable, using Xwayland should not be a issue. This category includes: <br />
<br />
* Xlib-based (and also other toolkit based on Xlib, e.g. tk, SDL1, etc), e.g. xterm, rxvt. Make sure XMODIFIERS is set correctly.<br />
* Gtk2-based applications, similar to Xlib, but can use fcitx im module. Set GTK_IM_MODULE to fcitx will give it best experience.<br />
* SDL2-based applications that doesn't default to wayland. Set SDL_IM_MODULE to fcitx<br />
* electron, chromium, these are still default to X11, similar to Gtk2 case.<br />
* For Qt4 applcation, Qt 4 can only use X11. You will need to QT_IM_MODULE to fcitx. Same for Qt5+ that uses XCB (can be override with QT_QPA_PLATFORM=xcb).<br />
<br />
=== Gtk3 / Gtk4 ===<br />
Gtk3 and Gtk4 support text-input-v3 natively. At the same time, it's also possible to use fcitx im module under wayland. So, either GTK_IM_MODULE=wayland or GTK_IM_MODULE=fcitx works. There are some difference to it. text-input-v3<br />
<br />
=== Qt5 / Qt6 ===<br />
If your Qt application natively runs under Wayland, you can either unset QT_IM_MODULE to make it use text-input-v2, or set QT_IM_MODULE=fcitx to make it use fcitx im module.<br />
<br />
text-input-v2 is not upstreamed to wayland-protocols, that is probably why only kwin support it. This means in non-kwin environment, you will need to use QT_IM_MODULE=fcitx to make the Qt applications work.<br />
<br />
On Qt6, you may also use QT_IM_MODULE= (empty) or QT_IM_MODULE=wayland if your Qt vesion contains this https://codereview.qt-project.org/c/qt/qtwayland/+/416862.<br />
<br />
=== Native wayland application (winit) ===<br />
Most likely text-input-v3 is being used.<br />
<br />
=== Chromium / Electron ===<br />
{{warning|The information in this section may not be up to date to reflect upstream change, especially the default behavior when no option is changed.}}<br />
<br />
You may force it to run with Wayland, or X11 with the flag <code>--ozone-platform=wayland</code> and <code>--ozone-platform=x11</code>. You may persistent this by changing the option "Preferred Ozone Platform" in chrome://flags. It has four values, "Default", "X11", "Wayland", "Auto".<br />
<br />
By default it should run under Xwayland (As of 2023/02/25 on Archlinux/Chromium 110.0.5481.177), but some user also reports it is using wayland even the "Preferred Ozone Platform" is "Default". So to check whether it's really run with wayland, you can use xeyes or xwininfo. With xeyes, if it's an X11 window, the "eyes" will move with mouse, otherwise it's wayland. With xwininfo, if the mouse cursor changed to "+" shape, and click the window shows the window information, then it is a X11 window.<br />
<br />
It's possible to make it use GTK_IM_MODULE if it runs with Gtk4 (only supported by chromium/chrome at this time, not electron) by passing <code>--gtk-version=4</code>.<br />
<br />
It's also possible to make it use text-input-v1 by passing <code>--enable-wayland-ime</code> in addition to the flag above.<br />
<br />
You should only use one of <code>--enable-wayland-ime</code> or <code>--gtk-version=4</code>, depending on you want to use text-input-v1, or gtk4 im module. text-input-v1 works for kwin 5.27 and weston. Gtk4 im module works on all environment, but only GNOME with Kimpanel extension can display the popup window in the correct position.<br />
<br />
== Desktop environment ==<br />
<br />
Even if you are using only native wayland applications, Xwayland is recommended to be enabled for following reason. If client side input panel in im module does not work, fcitx will fallback to a X11 window, instead of a wayland window. The reason for this is because wayland window can not be placed freely on the screen. On the contrary, even if im module can only pass a coordinate relative to the application window to fcitx, which make the coordinate position doesn't make much sense, if your application window size is "maximized", the coordinate may just be "right" if treated as the global coordinate. This makes X11 window a better option than a randomly placed wayland window.<br />
<br />
=== KDE Plasma ===<br />
* App/Compositor supports text-input-v2 and text-input-v3.<br />
* Comopositor/Application uses zwp_input_method_v1. <br />
* 5.27 additionally supports text-input-v1.<br />
* 5.24 usable zwp_input_method_v1 with fcitx5. Pre-5.24 there are lots of problems, always use fcitx im module instead.<br />
* Use "Virtual keyboard" KCM to launch fcitx5. This is required to use text-input protocol. If you launch fcitx this way, make sure you do not use "restart" in the tray menu, since the socket passed from KWin can not be reused with the newly restarted fcitx.<br />
<br />
=== GNOME ===<br />
* Application/Compositor uses text-input-v3<br />
* Compositor/Input Method uses ibus dbus protocol, so ibus frontend is required to be used.<br />
* Adding Fcitx 5 to autostart, it will replace any existing ibus-daemon upon start up so it will work out of box.<br />
* Popup candidate window is not able to be displayed over gnome-shell UI. Only solution is to use [[Special:MyLanguage/Kimpanel|Kimpanel]], [https://extensions.gnome.org/extension/261/kimpanel/ link to extension].<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Sway ===<br />
* Application/Compositor uses text-input-v3<br />
* Comopositor/Application uses zwp_input_method_v2, but it's partially implemented. You will need [https://github.com/swaywm/sway/pull/7226 this pull request] to make it show the popup candidate window for text-input-v3 client.<br />
* fcitx im module also works.<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Weston ===<br />
* Application/Compositor uses text-input-v1<br />
* Comopositor/Application uses zwp_input_method_v1.<br />
* Since it has no text-input-v3, which is more commonly used, im module is the only solution for Gtk/Qt, need to set GTK_IM_MODULE=fcitx and QT_IM_MODULE=fcitx.<br />
* Add following content to ~/.config/weston.ini to make it launch fcitx 5. (xwayland part is recommended to make fcitx work best, even if it's wayland)<br />
<br />
<pre><br />
[core]<br />
xwayland=true<br />
<br />
[input-method]<br />
path=/usr/bin/fcitx5<br />
</pre><br />
<br />
=== Other compositors ===<br />
Please check their upstream for more information. For wlroots based compositors, it is possible that they also support in the same way as Sway does, or zwp_input_method could also be unsupported.<br />
<br />
== Known Issues ==<br />
=== Fcitx managed XKB layout ===<br />
Unlike X11, there is no generic way to set XKB layout to compositor, which means it can only be implemented for every individual desktop. Right now, Fcitx managed layout only works for KDE Plasma.<br />
<br />
As for non-KDE desktop, in order to make this "semi" work you'll need to ensure following:<br />
<br />
* The system layout in the group should be the same as the actual xkb layout you configured for the compositor.<br />
* Configure only one layout.<br />
* If you need other layout for text typing (e.g. Arabic), just add them to the Fcitx. As long as the key is forwarded to fcitx, it should work.<br />
<br />
=== Popup candidate window ===<br />
Wayland does not have a global coordinate system for regular client, so for native wayland client, it is impossible for Fcitx to place a wayland surface at a certain position. In order for popup window to be placed at the correct position, there are following cases:<br />
* Xwayland have no problem and it should work as good as X11.<br />
* If zwp_input_method protocol can be used, it has a surface role to allow compositor to place the popup window for input method. This only works if client uses text-input protocol.<br />
* For GNOME, kimpanel extension can read window coordinate since it's running inside compositor. As long as im module can report relative coordinate, kimpanel extension can display the popup window at the correct position. As similar approach for Plasma kimpanel is planned, but not yet implemented.<br />
* For Gtk/Qt, fcitx's im module implement a way to render the popup with in the client process. This has some limitation because implemenation of xdg_popup in Gtk3/Qt5 doesn't support reposition the window. So show/hide trick is used to mitigate this, but it may cause window blinking. Fcitx tries not to move window if possible. You may also disable popup animation if you're using KWin to help reduce the blinking.<br />
<br />
=== Per-window input method state ===<br />
When zwp_input_method is used, essentially there is only one input context visible to fcitx, and fcitx cannot distinguish what application is being used. Which means the input method "active"/"inactivate" state is now "global".<br />
<br />
There is planned change to obtain the active application name and use "virtual" input context for wayland frontend. It's not yet in the stable version of Fcitx.</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Using_Fcitx_5_on_Wayland&diff=45426Using Fcitx 5 on Wayland2023-02-23T03:35:23Z<p>Weng Xuetian: /* KDE Plasma */</p>
<hr />
<div>[https://wayland.freedesktop.org/ Wayland] is the next generation of display server protocol. While the initial release of the protocol is in 2008, the support of input method is not really ideal.<br />
<br />
Also, using input method on Wayland-based compositor may require different setup to make it work, and certain features of fcitx that works under X11 are not yet supported by Wayland.<br />
<br />
This page will try to cover all the current information with some underlying details, and [[Special:MyLanguage/Setup Fcitx 5|Setup Fcitx 5]] is still generally useful.<br />
<br />
== Applications ==<br />
=== Legacy X11 application that runs under XWayland ===<br />
In a word, XWayland support for input method is as good as normal X11 display server. As long as you set the same environment variable, using Xwayland should not be a issue. This category includes: <br />
<br />
* Xlib-based (and also other toolkit based on Xlib, e.g. tk, SDL1, etc), e.g. xterm, rxvt. Make sure XMODIFIERS is set correctly.<br />
* Gtk2-based applications, similar to Xlib, but can use fcitx im module. Set GTK_IM_MODULE to fcitx will give it best experience.<br />
* SDL2-based applications that doesn't default to wayland. Set SDL_IM_MODULE to fcitx<br />
* electron, chromium, these are still default to X11, similar to Gtk2 case.<br />
* For Qt4 applcation, Qt 4 can only use X11. You will need to QT_IM_MODULE to fcitx. Same for Qt5+ that uses XCB (can be override with QT_QPA_PLATFORM=xcb).<br />
<br />
=== Gtk3 / Gtk4 ===<br />
Gtk3 and Gtk4 support text-input-v3 natively. At the same time, it's also possible to use fcitx im module under wayland. So, either GTK_IM_MODULE=wayland or GTK_IM_MODULE=fcitx works. There are some difference to it. text-input-v3<br />
<br />
=== Qt5 / Qt6 ===<br />
If your Qt application natively runs under Wayland, you can either unset QT_IM_MODULE to make it use text-input-v2, or set QT_IM_MODULE=fcitx to make it use fcitx im module.<br />
<br />
text-input-v2 is not upstreamed to wayland-protocols, that is probably why only kwin support it. This means in non-kwin environment, you will need to use QT_IM_MODULE=fcitx to make the Qt applications work.<br />
<br />
On Qt6, you may also use QT_IM_MODULE= (empty) or QT_IM_MODULE=wayland if your Qt vesion contains this https://codereview.qt-project.org/c/qt/qtwayland/+/416862.<br />
<br />
=== Native wayland application (winit) ===<br />
Most likely text-input-v3 is being used.<br />
<br />
=== Chromium / Electron ===<br />
By default it runs under Xwayland, to make it runs natively under wayland, you can enforce ozone platform to wayland (in some about: or by command line <code>--enable-features=UseOzonePlatform --ozone-platform=wayland</code>).<br />
<br />
It's possible to make it use GTK_IM_MODULE if it runs with Gtk4 (only supported by chromium/chrome at this time, not electron) by passing <code>--gtk-version=4</code>.<br />
<br />
It's also possible to make it use text-input-v1 by passing <code>--enable-wayland-ime</code> in addition to the flag above.<br />
<br />
You should only use one of <code>--enable-wayland-ime</code> or <code>--gtk-version=4</code>, depending on you want to use text-input-v1, or gtk4 im module. text-input-v1 works for kwin 5.27 and weston. Gtk4 im module works on all environment, but only GNOME with Kimpanel extension can display the popup window in the correct position.<br />
<br />
== Desktop environment ==<br />
<br />
Even if you are using only native wayland applications, Xwayland is recommended to be enabled for following reason. If client side input panel in im module does not work, fcitx will fallback to a X11 window, instead of a wayland window. The reason for this is because wayland window can not be placed freely on the screen. On the contrary, even if im module can only pass a coordinate relative to the application window to fcitx, which make the coordinate position doesn't make much sense, if your application window size is "maximized", the coordinate may just be "right" if treated as the global coordinate. This makes X11 window a better option than a randomly placed wayland window.<br />
<br />
=== KDE Plasma ===<br />
* App/Compositor supports text-input-v2 and text-input-v3.<br />
* Comopositor/Application uses zwp_input_method_v1. <br />
* 5.27 additionally supports text-input-v1.<br />
* 5.24 usable zwp_input_method_v1 with fcitx5. Pre-5.24 there are lots of problems, always use fcitx im module instead.<br />
* Use "Virtual keyboard" KCM to launch fcitx5. This is required to use text-input protocol. If you launch fcitx this way, make sure you do not use "restart" in the tray menu, since the socket passed from KWin can not be reused with the newly restarted fcitx.<br />
<br />
=== GNOME ===<br />
* Application/Compositor uses text-input-v3<br />
* Compositor/Input Method uses ibus dbus protocol, so ibus frontend is required to be used.<br />
* Adding Fcitx 5 to autostart, it will replace any existing ibus-daemon upon start up so it will work out of box.<br />
* Popup candidate window is not able to be displayed over gnome-shell UI. Only solution is to use [[Special:MyLanguage/Kimpanel|Kimpanel]], [https://extensions.gnome.org/extension/261/kimpanel/ link to extension].<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Sway ===<br />
* Application/Compositor uses text-input-v3<br />
* Comopositor/Application uses zwp_input_method_v2, but it's partially implemented. You will need [https://github.com/swaywm/sway/pull/7226 this pull request] to make it show the popup candidate window for text-input-v3 client.<br />
* fcitx im module also works.<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Weston ===<br />
* Application/Compositor uses text-input-v1<br />
* Comopositor/Application uses zwp_input_method_v1.<br />
* Since it has no text-input-v3, which is more commonly used, im module is the only solution for Gtk/Qt, need to set GTK_IM_MODULE=fcitx and QT_IM_MODULE=fcitx.<br />
* Add following content to ~/.config/weston.ini to make it launch fcitx 5. (xwayland part is recommended to make fcitx work best, even if it's wayland)<br />
<br />
<pre><br />
[core]<br />
xwayland=true<br />
<br />
[input-method]<br />
path=/usr/bin/fcitx5<br />
</pre><br />
<br />
=== Other compositors ===<br />
Please check their upstream for more information. For wlroots based compositors, it is possible that they also support in the same way as Sway does, or zwp_input_method could also be unsupported.<br />
<br />
== Known Issues ==<br />
=== Fcitx managed XKB layout ===<br />
Unlike X11, there is no generic way to set XKB layout to compositor, which means it can only be implemented for every individual desktop. Right now, Fcitx managed layout only works for KDE Plasma.<br />
<br />
As for non-KDE desktop, in order to make this "semi" work you'll need to ensure following:<br />
<br />
* The system layout in the group should be the same as the actual xkb layout you configured for the compositor.<br />
* Configure only one layout.<br />
* If you need other layout for text typing (e.g. Arabic), just add them to the Fcitx. As long as the key is forwarded to fcitx, it should work.<br />
<br />
=== Popup candidate window ===<br />
Wayland does not have a global coordinate system for regular client, so for native wayland client, it is impossible for Fcitx to place a wayland surface at a certain position. In order for popup window to be placed at the correct position, there are following cases:<br />
* Xwayland have no problem and it should work as good as X11.<br />
* If zwp_input_method protocol can be used, it has a surface role to allow compositor to place the popup window for input method. This only works if client uses text-input protocol.<br />
* For GNOME, kimpanel extension can read window coordinate since it's running inside compositor. As long as im module can report relative coordinate, kimpanel extension can display the popup window at the correct position. As similar approach for Plasma kimpanel is planned, but not yet implemented.<br />
* For Gtk/Qt, fcitx's im module implement a way to render the popup with in the client process. This has some limitation because implemenation of xdg_popup in Gtk3/Qt5 doesn't support reposition the window. So show/hide trick is used to mitigate this, but it may cause window blinking. Fcitx tries not to move window if possible. You may also disable popup animation if you're using KWin to help reduce the blinking.<br />
<br />
=== Per-window input method state ===<br />
When zwp_input_method is used, essentially there is only one input context visible to fcitx, and fcitx cannot distinguish what application is being used. Which means the input method "active"/"inactivate" state is now "global".<br />
<br />
There is planned change to obtain the active application name and use "virtual" input context for wayland frontend. It's not yet in the stable version of Fcitx.</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Using_Fcitx_5_on_Wayland&diff=45425Using Fcitx 5 on Wayland2023-02-22T02:51:34Z<p>Weng Xuetian: </p>
<hr />
<div>[https://wayland.freedesktop.org/ Wayland] is the next generation of display server protocol. While the initial release of the protocol is in 2008, the support of input method is not really ideal.<br />
<br />
Also, using input method on Wayland-based compositor may require different setup to make it work, and certain features of fcitx that works under X11 are not yet supported by Wayland.<br />
<br />
This page will try to cover all the current information with some underlying details, and [[Special:MyLanguage/Setup Fcitx 5|Setup Fcitx 5]] is still generally useful.<br />
<br />
== Applications ==<br />
=== Legacy X11 application that runs under XWayland ===<br />
In a word, XWayland support for input method is as good as normal X11 display server. As long as you set the same environment variable, using Xwayland should not be a issue. This category includes: <br />
<br />
* Xlib-based (and also other toolkit based on Xlib, e.g. tk, SDL1, etc), e.g. xterm, rxvt. Make sure XMODIFIERS is set correctly.<br />
* Gtk2-based applications, similar to Xlib, but can use fcitx im module. Set GTK_IM_MODULE to fcitx will give it best experience.<br />
* SDL2-based applications that doesn't default to wayland. Set SDL_IM_MODULE to fcitx<br />
* electron, chromium, these are still default to X11, similar to Gtk2 case.<br />
* For Qt4 applcation, Qt 4 can only use X11. You will need to QT_IM_MODULE to fcitx. Same for Qt5+ that uses XCB (can be override with QT_QPA_PLATFORM=xcb).<br />
<br />
=== Gtk3 / Gtk4 ===<br />
Gtk3 and Gtk4 support text-input-v3 natively. At the same time, it's also possible to use fcitx im module under wayland. So, either GTK_IM_MODULE=wayland or GTK_IM_MODULE=fcitx works. There are some difference to it. text-input-v3<br />
<br />
=== Qt5 / Qt6 ===<br />
If your Qt application natively runs under Wayland, you can either unset QT_IM_MODULE to make it use text-input-v2, or set QT_IM_MODULE=fcitx to make it use fcitx im module.<br />
<br />
text-input-v2 is not upstreamed to wayland-protocols, that is probably why only kwin support it. This means in non-kwin environment, you will need to use QT_IM_MODULE=fcitx to make the Qt applications work.<br />
<br />
On Qt6, you may also use QT_IM_MODULE= (empty) or QT_IM_MODULE=wayland if your Qt vesion contains this https://codereview.qt-project.org/c/qt/qtwayland/+/416862.<br />
<br />
=== Native wayland application (winit) ===<br />
Most likely text-input-v3 is being used.<br />
<br />
=== Chromium / Electron ===<br />
By default it runs under Xwayland, to make it runs natively under wayland, you can enforce ozone platform to wayland (in some about: or by command line <code>--enable-features=UseOzonePlatform --ozone-platform=wayland</code>).<br />
<br />
It's possible to make it use GTK_IM_MODULE if it runs with Gtk4 (only supported by chromium/chrome at this time, not electron) by passing <code>--gtk-version=4</code>.<br />
<br />
It's also possible to make it use text-input-v1 by passing <code>--enable-wayland-ime</code> in addition to the flag above.<br />
<br />
You should only use one of <code>--enable-wayland-ime</code> or <code>--gtk-version=4</code>, depending on you want to use text-input-v1, or gtk4 im module. text-input-v1 works for kwin 5.27 and weston. Gtk4 im module works on all environment, but only GNOME with Kimpanel extension can display the popup window in the correct position.<br />
<br />
== Desktop environment ==<br />
<br />
Even if you are using only native wayland applications, Xwayland is recommended to be enabled for following reason. If client side input panel in im module does not work, fcitx will fallback to a X11 window, instead of a wayland window. The reason for this is because wayland window can not be placed freely on the screen. On the contrary, even if im module can only pass a coordinate relative to the application window to fcitx, which make the coordinate position doesn't make much sense, if your application window size is "maximized", the coordinate may just be "right" if treated as the global coordinate. This makes X11 window a better option than a randomly placed wayland window.<br />
<br />
=== KDE Plasma ===<br />
* App/Compositor supports text-input-v2 and text-input-v3.<br />
* Comopositor/Application uses zwp_input_method_v1. <br />
* 5.27 additionally supports text-input-v1.<br />
* 5.24 usable zwp_input_method_v1 with fcitx5. Pre-5.24 there are lots of problems, always use fcitx im module instead.<br />
* Use "Virtual keyboard" KCM to launch fcitx5 instead of XDG autostart.<br />
<br />
=== GNOME ===<br />
* Application/Compositor uses text-input-v3<br />
* Compositor/Input Method uses ibus dbus protocol, so ibus frontend is required to be used.<br />
* Adding Fcitx 5 to autostart, it will replace any existing ibus-daemon upon start up so it will work out of box.<br />
* Popup candidate window is not able to be displayed over gnome-shell UI. Only solution is to use [[Special:MyLanguage/Kimpanel|Kimpanel]], [https://extensions.gnome.org/extension/261/kimpanel/ link to extension].<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Sway ===<br />
* Application/Compositor uses text-input-v3<br />
* Comopositor/Application uses zwp_input_method_v2, but it's partially implemented. You will need [https://github.com/swaywm/sway/pull/7226 this pull request] to make it show the popup candidate window for text-input-v3 client.<br />
* fcitx im module also works.<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Weston ===<br />
* Application/Compositor uses text-input-v1<br />
* Comopositor/Application uses zwp_input_method_v1.<br />
* Since it has no text-input-v3, which is more commonly used, im module is the only solution for Gtk/Qt, need to set GTK_IM_MODULE=fcitx and QT_IM_MODULE=fcitx.<br />
* Add following content to ~/.config/weston.ini to make it launch fcitx 5. (xwayland part is recommended to make fcitx work best, even if it's wayland)<br />
<br />
<pre><br />
[core]<br />
xwayland=true<br />
<br />
[input-method]<br />
path=/usr/bin/fcitx5<br />
</pre><br />
<br />
=== Other compositors ===<br />
Please check their upstream for more information. For wlroots based compositors, it is possible that they also support in the same way as Sway does, or zwp_input_method could also be unsupported.<br />
<br />
== Known Issues ==<br />
=== Fcitx managed XKB layout ===<br />
Unlike X11, there is no generic way to set XKB layout to compositor, which means it can only be implemented for every individual desktop. Right now, Fcitx managed layout only works for KDE Plasma.<br />
<br />
As for non-KDE desktop, in order to make this "semi" work you'll need to ensure following:<br />
<br />
* The system layout in the group should be the same as the actual xkb layout you configured for the compositor.<br />
* Configure only one layout.<br />
* If you need other layout for text typing (e.g. Arabic), just add them to the Fcitx. As long as the key is forwarded to fcitx, it should work.<br />
<br />
=== Popup candidate window ===<br />
Wayland does not have a global coordinate system for regular client, so for native wayland client, it is impossible for Fcitx to place a wayland surface at a certain position. In order for popup window to be placed at the correct position, there are following cases:<br />
* Xwayland have no problem and it should work as good as X11.<br />
* If zwp_input_method protocol can be used, it has a surface role to allow compositor to place the popup window for input method. This only works if client uses text-input protocol.<br />
* For GNOME, kimpanel extension can read window coordinate since it's running inside compositor. As long as im module can report relative coordinate, kimpanel extension can display the popup window at the correct position. As similar approach for Plasma kimpanel is planned, but not yet implemented.<br />
* For Gtk/Qt, fcitx's im module implement a way to render the popup with in the client process. This has some limitation because implemenation of xdg_popup in Gtk3/Qt5 doesn't support reposition the window. So show/hide trick is used to mitigate this, but it may cause window blinking. Fcitx tries not to move window if possible. You may also disable popup animation if you're using KWin to help reduce the blinking.<br />
<br />
=== Per-window input method state ===<br />
When zwp_input_method is used, essentially there is only one input context visible to fcitx, and fcitx cannot distinguish what application is being used. Which means the input method "active"/"inactivate" state is now "global".<br />
<br />
There is planned change to obtain the active application name and use "virtual" input context for wayland frontend. It's not yet in the stable version of Fcitx.</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Using_Fcitx_5_on_Wayland&diff=45424Using Fcitx 5 on Wayland2023-02-22T02:50:48Z<p>Weng Xuetian: /* Desktop environment */</p>
<hr />
<div>[https://wayland.freedesktop.org/ Wayland] is the next generation of display server protocol. While the initial release of the protocol is in 2008, the support of input method is not really ideal.<br />
<br />
Also, using input method on Wayland-based compositor may require different setup to make it work, and certain features of fcitx that works under X11 are not yet supported by Wayland.<br />
<br />
This page will try to cover all the current information with some underlying details, and [[Special:MyLanguage/Setup Fcitx 5|Setup Fcitx 5]] is still generally useful.<br />
<br />
== Applications ==<br />
=== Legacy X11 application that runs under XWayland ===<br />
In a word, XWayland support for input method is as good as normal X11 display server. As long as you set the same environment variable, using Xwayland should not be a issue. This category includes: <br />
<br />
* Xlib-based (and also other toolkit based on Xlib, e.g. tk, SDL1, etc), e.g. xterm, rxvt. Make sure XMODIFIERS is set correctly.<br />
* Gtk2-based applications, similar to Xlib, but can use fcitx im module. Set GTK_IM_MODULE to fcitx will give it best experience.<br />
* SDL2-based applications that doesn't default to wayland. Set SDL_IM_MODULE to fcitx<br />
* electron, chromium, these are still default to X11, similar to Gtk2 case.<br />
* For Qt4 applcation, Qt 4 can only use X11. You will need to QT_IM_MODULE to fcitx. Same for Qt5+ that uses XCB (can be override with QT_QPA_PLATFORM=xcb).<br />
<br />
=== Gtk3 / Gtk4 ===<br />
Gtk3 and Gtk4 support text-input-v3 natively. At the same time, it's also possible to use fcitx im module under wayland. So, either GTK_IM_MODULE=wayland or GTK_IM_MODULE=fcitx works. There are some difference to it. text-input-v3<br />
<br />
=== Qt5 / Qt6 ===<br />
If your Qt application natively runs under Wayland, you can either unset QT_IM_MODULE to make it use text-input-v2, or set QT_IM_MODULE=fcitx to make it use fcitx im module.<br />
<br />
text-input-v2 is not upstreamed to wayland-protocols, that is probably why only kwin support it. This means in non-kwin environment, you will need to use QT_IM_MODULE=fcitx to make the Qt applications work.<br />
<br />
On Qt6, you may also use QT_IM_MODULE= (empty) or QT_IM_MODULE=wayland if your Qt vesion contains this https://codereview.qt-project.org/c/qt/qtwayland/+/416862.<br />
<br />
=== Native wayland application (winit) ===<br />
Most likely text-input-v3 is being used.<br />
<br />
=== Chromium / Electron ===<br />
By default it runs under Xwayland, to make it runs natively under wayland, you can enforce ozone platform to wayland (in some about: or by command line <code>--enable-features=UseOzonePlatform --ozone-platform=wayland</code>).<br />
<br />
It's possible to make it use GTK_IM_MODULE if it runs with Gtk4 (only supported by chromium/chrome at this time, not electron) by passing <code>--gtk-version=4</code>.<br />
<br />
It's also possible to make it use text-input-v1 by passing <code>--enable-wayland-ime</code> in addition to the flag above.<br />
<br />
You should only use one of <code>--enable-wayland-ime</code> or <code>--gtk-version=4</code>, depending on you want to use text-input-v1, or gtk4 im module. text-input-v1 works for kwin 5.27 and weston. Gtk4 im module works on all environment, but only GNOME with Kimpanel extension can display the popup window in the correct position.<br />
<br />
Even if you are using only native wayland application, Xwayland is recommended for following reason. If client side input panel in im module does not work, fcitx will fallback to a X11 window, instead of a wayland window. The reason for this is because wayland window can not be placed freely on the screen. On the contrary, even if im module can only pass a coordinate relative to the application window to fcitx, which make the coordinate position doesn't make much sense, if your application window size is "maximized", the coordinate may just be "right" if treated as the global coordinate. This makes X11 window a better option than a randomly placed wayland window.<br />
<br />
== Desktop environment ==<br />
=== KDE Plasma ===<br />
* App/Compositor supports text-input-v2 and text-input-v3.<br />
* Comopositor/Application uses zwp_input_method_v1. <br />
* 5.27 additionally supports text-input-v1.<br />
* 5.24 usable zwp_input_method_v1 with fcitx5. Pre-5.24 there are lots of problems, always use fcitx im module instead.<br />
* Use "Virtual keyboard" KCM to launch fcitx5 instead of XDG autostart.<br />
<br />
=== GNOME ===<br />
* Application/Compositor uses text-input-v3<br />
* Compositor/Input Method uses ibus dbus protocol, so ibus frontend is required to be used.<br />
* Adding Fcitx 5 to autostart, it will replace any existing ibus-daemon upon start up so it will work out of box.<br />
* Popup candidate window is not able to be displayed over gnome-shell UI. Only solution is to use [[Special:MyLanguage/Kimpanel|Kimpanel]], [https://extensions.gnome.org/extension/261/kimpanel/ link to extension].<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Sway ===<br />
* Application/Compositor uses text-input-v3<br />
* Comopositor/Application uses zwp_input_method_v2, but it's partially implemented. You will need [https://github.com/swaywm/sway/pull/7226 this pull request] to make it show the popup candidate window for text-input-v3 client.<br />
* fcitx im module also works.<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Weston ===<br />
* Application/Compositor uses text-input-v1<br />
* Comopositor/Application uses zwp_input_method_v1.<br />
* Since it has no text-input-v3, which is more commonly used, im module is the only solution for Gtk/Qt, need to set GTK_IM_MODULE=fcitx and QT_IM_MODULE=fcitx.<br />
* Add following content to ~/.config/weston.ini to make it launch fcitx 5. (xwayland part is recommended to make fcitx work best, even if it's wayland)<br />
<br />
<pre><br />
[core]<br />
xwayland=true<br />
<br />
[input-method]<br />
path=/usr/bin/fcitx5<br />
</pre><br />
<br />
=== Other compositors ===<br />
Please check their upstream for more information. For wlroots based compositors, it is possible that they also support in the same way as Sway does, or zwp_input_method could also be unsupported.<br />
<br />
== Known Issues ==<br />
=== Fcitx managed XKB layout ===<br />
Unlike X11, there is no generic way to set XKB layout to compositor, which means it can only be implemented for every individual desktop. Right now, Fcitx managed layout only works for KDE Plasma.<br />
<br />
As for non-KDE desktop, in order to make this "semi" work you'll need to ensure following:<br />
<br />
* The system layout in the group should be the same as the actual xkb layout you configured for the compositor.<br />
* Configure only one layout.<br />
* If you need other layout for text typing (e.g. Arabic), just add them to the Fcitx. As long as the key is forwarded to fcitx, it should work.<br />
<br />
=== Popup candidate window ===<br />
Wayland does not have a global coordinate system for regular client, so for native wayland client, it is impossible for Fcitx to place a wayland surface at a certain position. In order for popup window to be placed at the correct position, there are following cases:<br />
* Xwayland have no problem and it should work as good as X11.<br />
* If zwp_input_method protocol can be used, it has a surface role to allow compositor to place the popup window for input method. This only works if client uses text-input protocol.<br />
* For GNOME, kimpanel extension can read window coordinate since it's running inside compositor. As long as im module can report relative coordinate, kimpanel extension can display the popup window at the correct position. As similar approach for Plasma kimpanel is planned, but not yet implemented.<br />
* For Gtk/Qt, fcitx's im module implement a way to render the popup with in the client process. This has some limitation because implemenation of xdg_popup in Gtk3/Qt5 doesn't support reposition the window. So show/hide trick is used to mitigate this, but it may cause window blinking. Fcitx tries not to move window if possible. You may also disable popup animation if you're using KWin to help reduce the blinking.<br />
<br />
=== Per-window input method state ===<br />
When zwp_input_method is used, essentially there is only one input context visible to fcitx, and fcitx cannot distinguish what application is being used. Which means the input method "active"/"inactivate" state is now "global".<br />
<br />
There is planned change to obtain the active application name and use "virtual" input context for wayland frontend. It's not yet in the stable version of Fcitx.</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Using_Fcitx_5_on_Wayland&diff=45423Using Fcitx 5 on Wayland2023-02-22T02:45:56Z<p>Weng Xuetian: /* Weston */</p>
<hr />
<div>[https://wayland.freedesktop.org/ Wayland] is the next generation of display server protocol. While the initial release of the protocol is in 2008, the support of input method is not really ideal.<br />
<br />
Also, using input method on Wayland-based compositor may require different setup to make it work, and certain features of fcitx that works under X11 are not yet supported by Wayland.<br />
<br />
This page will try to cover all the current information with some underlying details, and [[Special:MyLanguage/Setup Fcitx 5|Setup Fcitx 5]] is still generally useful.<br />
<br />
== Applications ==<br />
=== Legacy X11 application that runs under XWayland ===<br />
In a word, XWayland support for input method is as good as normal X11 display server. As long as you set the same environment variable, using Xwayland should not be a issue. This category includes: <br />
<br />
* Xlib-based (and also other toolkit based on Xlib, e.g. tk, SDL1, etc), e.g. xterm, rxvt. Make sure XMODIFIERS is set correctly.<br />
* Gtk2-based applications, similar to Xlib, but can use fcitx im module. Set GTK_IM_MODULE to fcitx will give it best experience.<br />
* SDL2-based applications that doesn't default to wayland. Set SDL_IM_MODULE to fcitx<br />
* electron, chromium, these are still default to X11, similar to Gtk2 case.<br />
* For Qt4 applcation, Qt 4 can only use X11. You will need to QT_IM_MODULE to fcitx. Same for Qt5+ that uses XCB (can be override with QT_QPA_PLATFORM=xcb).<br />
<br />
=== Gtk3 / Gtk4 ===<br />
Gtk3 and Gtk4 support text-input-v3 natively. At the same time, it's also possible to use fcitx im module under wayland. So, either GTK_IM_MODULE=wayland or GTK_IM_MODULE=fcitx works. There are some difference to it. text-input-v3<br />
<br />
=== Qt5 / Qt6 ===<br />
If your Qt application natively runs under Wayland, you can either unset QT_IM_MODULE to make it use text-input-v2, or set QT_IM_MODULE=fcitx to make it use fcitx im module.<br />
<br />
text-input-v2 is not upstreamed to wayland-protocols, that is probably why only kwin support it. This means in non-kwin environment, you will need to use QT_IM_MODULE=fcitx to make the Qt applications work.<br />
<br />
On Qt6, you may also use QT_IM_MODULE= (empty) or QT_IM_MODULE=wayland if your Qt vesion contains this https://codereview.qt-project.org/c/qt/qtwayland/+/416862.<br />
<br />
=== Native wayland application (winit) ===<br />
Most likely text-input-v3 is being used.<br />
<br />
=== Chromium / Electron ===<br />
By default it runs under Xwayland, to make it runs natively under wayland, you can enforce ozone platform to wayland (in some about: or by command line <code>--enable-features=UseOzonePlatform --ozone-platform=wayland</code>).<br />
<br />
It's possible to make it use GTK_IM_MODULE if it runs with Gtk4 (only supported by chromium/chrome at this time, not electron) by passing <code>--gtk-version=4</code>.<br />
<br />
It's also possible to make it use text-input-v1 by passing <code>--enable-wayland-ime</code> in addition to the flag above.<br />
<br />
You should only use one of <code>--enable-wayland-ime</code> or <code>--gtk-version=4</code>, depending on you want to use text-input-v1, or gtk4 im module. text-input-v1 works for kwin 5.27 and weston. Gtk4 im module works on all environment, but only GNOME with Kimpanel extension can display the popup window in the correct position.<br />
<br />
== Desktop environment ==<br />
=== KDE Plasma ===<br />
* App/Compositor supports text-input-v2 and text-input-v3.<br />
* Comopositor/Application uses zwp_input_method_v1. <br />
* 5.27 additionally supports text-input-v1.<br />
* 5.24 usable zwp_input_method_v1 with fcitx5. Pre-5.24 there are lots of problems, always use fcitx im module instead.<br />
* Use "Virtual keyboard" KCM to launch fcitx5 instead of XDG autostart.<br />
<br />
=== GNOME ===<br />
* Application/Compositor uses text-input-v3<br />
* Compositor/Input Method uses ibus dbus protocol, so ibus frontend is required to be used.<br />
* Adding Fcitx 5 to autostart, it will replace any existing ibus-daemon upon start up so it will work out of box.<br />
* Popup candidate window is not able to be displayed over gnome-shell UI. Only solution is to use [[Special:MyLanguage/Kimpanel|Kimpanel]], [https://extensions.gnome.org/extension/261/kimpanel/ link to extension].<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Sway ===<br />
* Application/Compositor uses text-input-v3<br />
* Comopositor/Application uses zwp_input_method_v2, but it's partially implemented. You will need [https://github.com/swaywm/sway/pull/7226 this pull request] to make it show the popup candidate window for text-input-v3 client.<br />
* fcitx im module also works.<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Weston ===<br />
* Application/Compositor uses text-input-v1<br />
* Comopositor/Application uses zwp_input_method_v1.<br />
* Since it has no text-input-v3, which is more commonly used, im module is the only solution for Gtk/Qt, need to set GTK_IM_MODULE=fcitx and QT_IM_MODULE=fcitx.<br />
* Add following content to ~/.config/weston.ini to make it launch fcitx 5. (xwayland part is recommended to make fcitx work best, even if it's wayland)<br />
<br />
<pre><br />
[core]<br />
xwayland=true<br />
<br />
[input-method]<br />
path=/usr/bin/fcitx5<br />
</pre><br />
<br />
=== Other compositors ===<br />
Please check their upstream for more information. For wlroots based compositors, it is possible that they also support in the same way as Sway does, or zwp_input_method could also be unsupported.<br />
<br />
== Known Issues ==<br />
=== Fcitx managed XKB layout ===<br />
Unlike X11, there is no generic way to set XKB layout to compositor, which means it can only be implemented for every individual desktop. Right now, Fcitx managed layout only works for KDE Plasma.<br />
<br />
As for non-KDE desktop, in order to make this "semi" work you'll need to ensure following:<br />
<br />
* The system layout in the group should be the same as the actual xkb layout you configured for the compositor.<br />
* Configure only one layout.<br />
* If you need other layout for text typing (e.g. Arabic), just add them to the Fcitx. As long as the key is forwarded to fcitx, it should work.<br />
<br />
=== Popup candidate window ===<br />
Wayland does not have a global coordinate system for regular client, so for native wayland client, it is impossible for Fcitx to place a wayland surface at a certain position. In order for popup window to be placed at the correct position, there are following cases:<br />
* Xwayland have no problem and it should work as good as X11.<br />
* If zwp_input_method protocol can be used, it has a surface role to allow compositor to place the popup window for input method. This only works if client uses text-input protocol.<br />
* For GNOME, kimpanel extension can read window coordinate since it's running inside compositor. As long as im module can report relative coordinate, kimpanel extension can display the popup window at the correct position. As similar approach for Plasma kimpanel is planned, but not yet implemented.<br />
* For Gtk/Qt, fcitx's im module implement a way to render the popup with in the client process. This has some limitation because implemenation of xdg_popup in Gtk3/Qt5 doesn't support reposition the window. So show/hide trick is used to mitigate this, but it may cause window blinking. Fcitx tries not to move window if possible. You may also disable popup animation if you're using KWin to help reduce the blinking.<br />
<br />
=== Per-window input method state ===<br />
When zwp_input_method is used, essentially there is only one input context visible to fcitx, and fcitx cannot distinguish what application is being used. Which means the input method "active"/"inactivate" state is now "global".<br />
<br />
There is planned change to obtain the active application name and use "virtual" input context for wayland frontend. It's not yet in the stable version of Fcitx.</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Using_Fcitx_5_on_Wayland&diff=45422Using Fcitx 5 on Wayland2023-02-22T02:42:47Z<p>Weng Xuetian: /* Chromium / Electron */</p>
<hr />
<div>[https://wayland.freedesktop.org/ Wayland] is the next generation of display server protocol. While the initial release of the protocol is in 2008, the support of input method is not really ideal.<br />
<br />
Also, using input method on Wayland-based compositor may require different setup to make it work, and certain features of fcitx that works under X11 are not yet supported by Wayland.<br />
<br />
This page will try to cover all the current information with some underlying details, and [[Special:MyLanguage/Setup Fcitx 5|Setup Fcitx 5]] is still generally useful.<br />
<br />
== Applications ==<br />
=== Legacy X11 application that runs under XWayland ===<br />
In a word, XWayland support for input method is as good as normal X11 display server. As long as you set the same environment variable, using Xwayland should not be a issue. This category includes: <br />
<br />
* Xlib-based (and also other toolkit based on Xlib, e.g. tk, SDL1, etc), e.g. xterm, rxvt. Make sure XMODIFIERS is set correctly.<br />
* Gtk2-based applications, similar to Xlib, but can use fcitx im module. Set GTK_IM_MODULE to fcitx will give it best experience.<br />
* SDL2-based applications that doesn't default to wayland. Set SDL_IM_MODULE to fcitx<br />
* electron, chromium, these are still default to X11, similar to Gtk2 case.<br />
* For Qt4 applcation, Qt 4 can only use X11. You will need to QT_IM_MODULE to fcitx. Same for Qt5+ that uses XCB (can be override with QT_QPA_PLATFORM=xcb).<br />
<br />
=== Gtk3 / Gtk4 ===<br />
Gtk3 and Gtk4 support text-input-v3 natively. At the same time, it's also possible to use fcitx im module under wayland. So, either GTK_IM_MODULE=wayland or GTK_IM_MODULE=fcitx works. There are some difference to it. text-input-v3<br />
<br />
=== Qt5 / Qt6 ===<br />
If your Qt application natively runs under Wayland, you can either unset QT_IM_MODULE to make it use text-input-v2, or set QT_IM_MODULE=fcitx to make it use fcitx im module.<br />
<br />
text-input-v2 is not upstreamed to wayland-protocols, that is probably why only kwin support it. This means in non-kwin environment, you will need to use QT_IM_MODULE=fcitx to make the Qt applications work.<br />
<br />
On Qt6, you may also use QT_IM_MODULE= (empty) or QT_IM_MODULE=wayland if your Qt vesion contains this https://codereview.qt-project.org/c/qt/qtwayland/+/416862.<br />
<br />
=== Native wayland application (winit) ===<br />
Most likely text-input-v3 is being used.<br />
<br />
=== Chromium / Electron ===<br />
By default it runs under Xwayland, to make it runs natively under wayland, you can enforce ozone platform to wayland (in some about: or by command line <code>--enable-features=UseOzonePlatform --ozone-platform=wayland</code>).<br />
<br />
It's possible to make it use GTK_IM_MODULE if it runs with Gtk4 (only supported by chromium/chrome at this time, not electron) by passing <code>--gtk-version=4</code>.<br />
<br />
It's also possible to make it use text-input-v1 by passing <code>--enable-wayland-ime</code> in addition to the flag above.<br />
<br />
You should only use one of <code>--enable-wayland-ime</code> or <code>--gtk-version=4</code>, depending on you want to use text-input-v1, or gtk4 im module. text-input-v1 works for kwin 5.27 and weston. Gtk4 im module works on all environment, but only GNOME with Kimpanel extension can display the popup window in the correct position.<br />
<br />
== Desktop environment ==<br />
=== KDE Plasma ===<br />
* App/Compositor supports text-input-v2 and text-input-v3.<br />
* Comopositor/Application uses zwp_input_method_v1. <br />
* 5.27 additionally supports text-input-v1.<br />
* 5.24 usable zwp_input_method_v1 with fcitx5. Pre-5.24 there are lots of problems, always use fcitx im module instead.<br />
* Use "Virtual keyboard" KCM to launch fcitx5 instead of XDG autostart.<br />
<br />
=== GNOME ===<br />
* Application/Compositor uses text-input-v3<br />
* Compositor/Input Method uses ibus dbus protocol, so ibus frontend is required to be used.<br />
* Adding Fcitx 5 to autostart, it will replace any existing ibus-daemon upon start up so it will work out of box.<br />
* Popup candidate window is not able to be displayed over gnome-shell UI. Only solution is to use [[Special:MyLanguage/Kimpanel|Kimpanel]], [https://extensions.gnome.org/extension/261/kimpanel/ link to extension].<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Sway ===<br />
* Application/Compositor uses text-input-v3<br />
* Comopositor/Application uses zwp_input_method_v2, but it's partially implemented. You will need [https://github.com/swaywm/sway/pull/7226 this pull request] to make it show the popup candidate window for text-input-v3 client.<br />
* fcitx im module also works.<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Weston ===<br />
* Application/Compositor uses text-input-v1<br />
* Comopositor/Application uses zwp_input_method_v1.<br />
* Since it has no text-input-v3, which is more commonly used, im module is the only solution for Gtk/Qt, need to set GTK_IM_MODULE=fcitx and QT_IM_MODULE=fcitx.<br />
<br />
=== Other compositors ===<br />
Please check their upstream for more information. For wlroots based compositors, it is possible that they also support in the same way as Sway does, or zwp_input_method could also be unsupported.<br />
<br />
== Known Issues ==<br />
=== Fcitx managed XKB layout ===<br />
Unlike X11, there is no generic way to set XKB layout to compositor, which means it can only be implemented for every individual desktop. Right now, Fcitx managed layout only works for KDE Plasma.<br />
<br />
As for non-KDE desktop, in order to make this "semi" work you'll need to ensure following:<br />
<br />
* The system layout in the group should be the same as the actual xkb layout you configured for the compositor.<br />
* Configure only one layout.<br />
* If you need other layout for text typing (e.g. Arabic), just add them to the Fcitx. As long as the key is forwarded to fcitx, it should work.<br />
<br />
=== Popup candidate window ===<br />
Wayland does not have a global coordinate system for regular client, so for native wayland client, it is impossible for Fcitx to place a wayland surface at a certain position. In order for popup window to be placed at the correct position, there are following cases:<br />
* Xwayland have no problem and it should work as good as X11.<br />
* If zwp_input_method protocol can be used, it has a surface role to allow compositor to place the popup window for input method. This only works if client uses text-input protocol.<br />
* For GNOME, kimpanel extension can read window coordinate since it's running inside compositor. As long as im module can report relative coordinate, kimpanel extension can display the popup window at the correct position. As similar approach for Plasma kimpanel is planned, but not yet implemented.<br />
* For Gtk/Qt, fcitx's im module implement a way to render the popup with in the client process. This has some limitation because implemenation of xdg_popup in Gtk3/Qt5 doesn't support reposition the window. So show/hide trick is used to mitigate this, but it may cause window blinking. Fcitx tries not to move window if possible. You may also disable popup animation if you're using KWin to help reduce the blinking.<br />
<br />
=== Per-window input method state ===<br />
When zwp_input_method is used, essentially there is only one input context visible to fcitx, and fcitx cannot distinguish what application is being used. Which means the input method "active"/"inactivate" state is now "global".<br />
<br />
There is planned change to obtain the active application name and use "virtual" input context for wayland frontend. It's not yet in the stable version of Fcitx.</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Using_Fcitx_5_on_Wayland&diff=45421Using Fcitx 5 on Wayland2023-02-22T02:24:44Z<p>Weng Xuetian: /* Desktop environment */</p>
<hr />
<div>[https://wayland.freedesktop.org/ Wayland] is the next generation of display server protocol. While the initial release of the protocol is in 2008, the support of input method is not really ideal.<br />
<br />
Also, using input method on Wayland-based compositor may require different setup to make it work, and certain features of fcitx that works under X11 are not yet supported by Wayland.<br />
<br />
This page will try to cover all the current information with some underlying details, and [[Special:MyLanguage/Setup Fcitx 5|Setup Fcitx 5]] is still generally useful.<br />
<br />
== Applications ==<br />
=== Legacy X11 application that runs under XWayland ===<br />
In a word, XWayland support for input method is as good as normal X11 display server. As long as you set the same environment variable, using Xwayland should not be a issue. This category includes: <br />
<br />
* Xlib-based (and also other toolkit based on Xlib, e.g. tk, SDL1, etc), e.g. xterm, rxvt. Make sure XMODIFIERS is set correctly.<br />
* Gtk2-based applications, similar to Xlib, but can use fcitx im module. Set GTK_IM_MODULE to fcitx will give it best experience.<br />
* SDL2-based applications that doesn't default to wayland. Set SDL_IM_MODULE to fcitx<br />
* electron, chromium, these are still default to X11, similar to Gtk2 case.<br />
* For Qt4 applcation, Qt 4 can only use X11. You will need to QT_IM_MODULE to fcitx. Same for Qt5+ that uses XCB (can be override with QT_QPA_PLATFORM=xcb).<br />
<br />
=== Gtk3 / Gtk4 ===<br />
Gtk3 and Gtk4 support text-input-v3 natively. At the same time, it's also possible to use fcitx im module under wayland. So, either GTK_IM_MODULE=wayland or GTK_IM_MODULE=fcitx works. There are some difference to it. text-input-v3<br />
<br />
=== Qt5 / Qt6 ===<br />
If your Qt application natively runs under Wayland, you can either unset QT_IM_MODULE to make it use text-input-v2, or set QT_IM_MODULE=fcitx to make it use fcitx im module.<br />
<br />
text-input-v2 is not upstreamed to wayland-protocols, that is probably why only kwin support it. This means in non-kwin environment, you will need to use QT_IM_MODULE=fcitx to make the Qt applications work.<br />
<br />
On Qt6, you may also use QT_IM_MODULE= (empty) or QT_IM_MODULE=wayland if your Qt vesion contains this https://codereview.qt-project.org/c/qt/qtwayland/+/416862.<br />
<br />
=== Native wayland application (winit) ===<br />
Most likely text-input-v3 is being used.<br />
<br />
=== Chromium / Electron ===<br />
By default it runs under Xwayland, to make it runs natively under wayland, you can enforce ozone platform to wayland (in some about: or by command line --enable-features=UseOzonePlatform --ozone-platform=wayland).<br />
<br />
It's possible to make it use GTK_IM_MODULE if it runs with Gtk4 (only supported by chromium/chrome at this time, not electron).<br />
<br />
It's also possible to make it use text-input-v1 by pass --enable-wayland-ime. <br />
<br />
== Desktop environment ==<br />
=== KDE Plasma ===<br />
* App/Compositor supports text-input-v2 and text-input-v3.<br />
* Comopositor/Application uses zwp_input_method_v1. <br />
* 5.27 additionally supports text-input-v1.<br />
* 5.24 usable zwp_input_method_v1 with fcitx5. Pre-5.24 there are lots of problems, always use fcitx im module instead.<br />
* Use "Virtual keyboard" KCM to launch fcitx5 instead of XDG autostart.<br />
<br />
=== GNOME ===<br />
* Application/Compositor uses text-input-v3<br />
* Compositor/Input Method uses ibus dbus protocol, so ibus frontend is required to be used.<br />
* Adding Fcitx 5 to autostart, it will replace any existing ibus-daemon upon start up so it will work out of box.<br />
* Popup candidate window is not able to be displayed over gnome-shell UI. Only solution is to use [[Special:MyLanguage/Kimpanel|Kimpanel]], [https://extensions.gnome.org/extension/261/kimpanel/ link to extension].<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Sway ===<br />
* Application/Compositor uses text-input-v3<br />
* Comopositor/Application uses zwp_input_method_v2, but it's partially implemented. You will need [https://github.com/swaywm/sway/pull/7226 this pull request] to make it show the popup candidate window for text-input-v3 client.<br />
* fcitx im module also works.<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Weston ===<br />
* Application/Compositor uses text-input-v1<br />
* Comopositor/Application uses zwp_input_method_v1.<br />
* Since it has no text-input-v3, which is more commonly used, im module is the only solution for Gtk/Qt, need to set GTK_IM_MODULE=fcitx and QT_IM_MODULE=fcitx.<br />
<br />
=== Other compositors ===<br />
Please check their upstream for more information. For wlroots based compositors, it is possible that they also support in the same way as Sway does, or zwp_input_method could also be unsupported.<br />
<br />
== Known Issues ==<br />
=== Fcitx managed XKB layout ===<br />
Unlike X11, there is no generic way to set XKB layout to compositor, which means it can only be implemented for every individual desktop. Right now, Fcitx managed layout only works for KDE Plasma.<br />
<br />
As for non-KDE desktop, in order to make this "semi" work you'll need to ensure following:<br />
<br />
* The system layout in the group should be the same as the actual xkb layout you configured for the compositor.<br />
* Configure only one layout.<br />
* If you need other layout for text typing (e.g. Arabic), just add them to the Fcitx. As long as the key is forwarded to fcitx, it should work.<br />
<br />
=== Popup candidate window ===<br />
Wayland does not have a global coordinate system for regular client, so for native wayland client, it is impossible for Fcitx to place a wayland surface at a certain position. In order for popup window to be placed at the correct position, there are following cases:<br />
* Xwayland have no problem and it should work as good as X11.<br />
* If zwp_input_method protocol can be used, it has a surface role to allow compositor to place the popup window for input method. This only works if client uses text-input protocol.<br />
* For GNOME, kimpanel extension can read window coordinate since it's running inside compositor. As long as im module can report relative coordinate, kimpanel extension can display the popup window at the correct position. As similar approach for Plasma kimpanel is planned, but not yet implemented.<br />
* For Gtk/Qt, fcitx's im module implement a way to render the popup with in the client process. This has some limitation because implemenation of xdg_popup in Gtk3/Qt5 doesn't support reposition the window. So show/hide trick is used to mitigate this, but it may cause window blinking. Fcitx tries not to move window if possible. You may also disable popup animation if you're using KWin to help reduce the blinking.<br />
<br />
=== Per-window input method state ===<br />
When zwp_input_method is used, essentially there is only one input context visible to fcitx, and fcitx cannot distinguish what application is being used. Which means the input method "active"/"inactivate" state is now "global".<br />
<br />
There is planned change to obtain the active application name and use "virtual" input context for wayland frontend. It's not yet in the stable version of Fcitx.</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Using_Fcitx_5_on_Wayland&diff=45420Using Fcitx 5 on Wayland2023-02-22T02:22:53Z<p>Weng Xuetian: /* Weston */</p>
<hr />
<div>[https://wayland.freedesktop.org/ Wayland] is the next generation of display server protocol. While the initial release of the protocol is in 2008, the support of input method is not really ideal.<br />
<br />
Also, using input method on Wayland-based compositor may require different setup to make it work, and certain features of fcitx that works under X11 are not yet supported by Wayland.<br />
<br />
This page will try to cover all the current information with some underlying details, and [[Special:MyLanguage/Setup Fcitx 5|Setup Fcitx 5]] is still generally useful.<br />
<br />
== Applications ==<br />
=== Legacy X11 application that runs under XWayland ===<br />
In a word, XWayland support for input method is as good as normal X11 display server. As long as you set the same environment variable, using Xwayland should not be a issue. This category includes: <br />
<br />
* Xlib-based (and also other toolkit based on Xlib, e.g. tk, SDL1, etc), e.g. xterm, rxvt. Make sure XMODIFIERS is set correctly.<br />
* Gtk2-based applications, similar to Xlib, but can use fcitx im module. Set GTK_IM_MODULE to fcitx will give it best experience.<br />
* SDL2-based applications that doesn't default to wayland. Set SDL_IM_MODULE to fcitx<br />
* electron, chromium, these are still default to X11, similar to Gtk2 case.<br />
* For Qt4 applcation, Qt 4 can only use X11. You will need to QT_IM_MODULE to fcitx. Same for Qt5+ that uses XCB (can be override with QT_QPA_PLATFORM=xcb).<br />
<br />
=== Gtk3 / Gtk4 ===<br />
Gtk3 and Gtk4 support text-input-v3 natively. At the same time, it's also possible to use fcitx im module under wayland. So, either GTK_IM_MODULE=wayland or GTK_IM_MODULE=fcitx works. There are some difference to it. text-input-v3<br />
<br />
=== Qt5 / Qt6 ===<br />
If your Qt application natively runs under Wayland, you can either unset QT_IM_MODULE to make it use text-input-v2, or set QT_IM_MODULE=fcitx to make it use fcitx im module.<br />
<br />
text-input-v2 is not upstreamed to wayland-protocols, that is probably why only kwin support it. This means in non-kwin environment, you will need to use QT_IM_MODULE=fcitx to make the Qt applications work.<br />
<br />
On Qt6, you may also use QT_IM_MODULE= (empty) or QT_IM_MODULE=wayland if your Qt vesion contains this https://codereview.qt-project.org/c/qt/qtwayland/+/416862.<br />
<br />
=== Native wayland application (winit) ===<br />
Most likely text-input-v3 is being used.<br />
<br />
=== Chromium / Electron ===<br />
By default it runs under Xwayland, to make it runs natively under wayland, you can enforce ozone platform to wayland (in some about: or by command line --enable-features=UseOzonePlatform --ozone-platform=wayland).<br />
<br />
It's possible to make it use GTK_IM_MODULE if it runs with Gtk4 (only supported by chromium/chrome at this time, not electron).<br />
<br />
It's also possible to make it use text-input-v1 by pass --enable-wayland-ime. <br />
<br />
== Desktop environment ==<br />
=== KDE Plasma ===<br />
* App/Compositor supports text-input-v2 and text-input-v3.<br />
* Comopositor/Application uses zwp_input_method_v1. <br />
* 5.27 additionally supports text-input-v1.<br />
* 5.24 usable zwp_input_method_v1 with fcitx5. Pre-5.24 there are lots of problems, always use fcitx im module instead.<br />
* Use "Virtual keyboard" KCM to launch fcitx5 instead of XDG autostart.<br />
<br />
=== GNOME ===<br />
* Application/Compositor uses text-input-v3<br />
* Compositor/Input Method uses ibus dbus protocol, so ibus frontend is required to be used.<br />
* Adding Fcitx 5 to autostart, it will replace any existing ibus-daemon upon start up so it will work out of box.<br />
* Popup candidate window is not able to be displayed over gnome-shell UI. Only solution is to use [[Special:MyLanguage/Kimpanel|Kimpanel]], [https://extensions.gnome.org/extension/261/kimpanel/ link to extension].<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Sway ===<br />
* Application/Compositor uses text-input-v3<br />
* Comopositor/Application uses zwp_input_method_v2, but it's partially implemented. You will need [https://github.com/swaywm/sway/pull/7226 this pull request] to make it show the popup candidate window for text-input-v3 client.<br />
* fcitx im module also works.<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Weston ===<br />
* Application/Compositor uses text-input-v1<br />
* Comopositor/Application uses zwp_input_method_v1.<br />
* Since it has no text-input-v3, which is more commonly used, im module is the only solution for Gtk/Qt, need to set GTK_IM_MODULE=fcitx and QT_IM_MODULE=fcitx.<br />
<br />
== Known Issues ==<br />
=== Fcitx managed XKB layout ===<br />
Unlike X11, there is no generic way to set XKB layout to compositor, which means it can only be implemented for every individual desktop. Right now, Fcitx managed layout only works for KDE Plasma.<br />
<br />
As for non-KDE desktop, in order to make this "semi" work you'll need to ensure following:<br />
<br />
* The system layout in the group should be the same as the actual xkb layout you configured for the compositor.<br />
* Configure only one layout.<br />
* If you need other layout for text typing (e.g. Arabic), just add them to the Fcitx. As long as the key is forwarded to fcitx, it should work.<br />
<br />
=== Popup candidate window ===<br />
Wayland does not have a global coordinate system for regular client, so for native wayland client, it is impossible for Fcitx to place a wayland surface at a certain position. In order for popup window to be placed at the correct position, there are following cases:<br />
* Xwayland have no problem and it should work as good as X11.<br />
* If zwp_input_method protocol can be used, it has a surface role to allow compositor to place the popup window for input method. This only works if client uses text-input protocol.<br />
* For GNOME, kimpanel extension can read window coordinate since it's running inside compositor. As long as im module can report relative coordinate, kimpanel extension can display the popup window at the correct position. As similar approach for Plasma kimpanel is planned, but not yet implemented.<br />
* For Gtk/Qt, fcitx's im module implement a way to render the popup with in the client process. This has some limitation because implemenation of xdg_popup in Gtk3/Qt5 doesn't support reposition the window. So show/hide trick is used to mitigate this, but it may cause window blinking. Fcitx tries not to move window if possible. You may also disable popup animation if you're using KWin to help reduce the blinking.<br />
<br />
=== Per-window input method state ===<br />
When zwp_input_method is used, essentially there is only one input context visible to fcitx, and fcitx cannot distinguish what application is being used. Which means the input method "active"/"inactivate" state is now "global".<br />
<br />
There is planned change to obtain the active application name and use "virtual" input context for wayland frontend. It's not yet in the stable version of Fcitx.</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Using_Fcitx_5_on_Wayland&diff=45419Using Fcitx 5 on Wayland2023-02-22T02:22:28Z<p>Weng Xuetian: /* Weston */</p>
<hr />
<div>[https://wayland.freedesktop.org/ Wayland] is the next generation of display server protocol. While the initial release of the protocol is in 2008, the support of input method is not really ideal.<br />
<br />
Also, using input method on Wayland-based compositor may require different setup to make it work, and certain features of fcitx that works under X11 are not yet supported by Wayland.<br />
<br />
This page will try to cover all the current information with some underlying details, and [[Special:MyLanguage/Setup Fcitx 5|Setup Fcitx 5]] is still generally useful.<br />
<br />
== Applications ==<br />
=== Legacy X11 application that runs under XWayland ===<br />
In a word, XWayland support for input method is as good as normal X11 display server. As long as you set the same environment variable, using Xwayland should not be a issue. This category includes: <br />
<br />
* Xlib-based (and also other toolkit based on Xlib, e.g. tk, SDL1, etc), e.g. xterm, rxvt. Make sure XMODIFIERS is set correctly.<br />
* Gtk2-based applications, similar to Xlib, but can use fcitx im module. Set GTK_IM_MODULE to fcitx will give it best experience.<br />
* SDL2-based applications that doesn't default to wayland. Set SDL_IM_MODULE to fcitx<br />
* electron, chromium, these are still default to X11, similar to Gtk2 case.<br />
* For Qt4 applcation, Qt 4 can only use X11. You will need to QT_IM_MODULE to fcitx. Same for Qt5+ that uses XCB (can be override with QT_QPA_PLATFORM=xcb).<br />
<br />
=== Gtk3 / Gtk4 ===<br />
Gtk3 and Gtk4 support text-input-v3 natively. At the same time, it's also possible to use fcitx im module under wayland. So, either GTK_IM_MODULE=wayland or GTK_IM_MODULE=fcitx works. There are some difference to it. text-input-v3<br />
<br />
=== Qt5 / Qt6 ===<br />
If your Qt application natively runs under Wayland, you can either unset QT_IM_MODULE to make it use text-input-v2, or set QT_IM_MODULE=fcitx to make it use fcitx im module.<br />
<br />
text-input-v2 is not upstreamed to wayland-protocols, that is probably why only kwin support it. This means in non-kwin environment, you will need to use QT_IM_MODULE=fcitx to make the Qt applications work.<br />
<br />
On Qt6, you may also use QT_IM_MODULE= (empty) or QT_IM_MODULE=wayland if your Qt vesion contains this https://codereview.qt-project.org/c/qt/qtwayland/+/416862.<br />
<br />
=== Native wayland application (winit) ===<br />
Most likely text-input-v3 is being used.<br />
<br />
=== Chromium / Electron ===<br />
By default it runs under Xwayland, to make it runs natively under wayland, you can enforce ozone platform to wayland (in some about: or by command line --enable-features=UseOzonePlatform --ozone-platform=wayland).<br />
<br />
It's possible to make it use GTK_IM_MODULE if it runs with Gtk4 (only supported by chromium/chrome at this time, not electron).<br />
<br />
It's also possible to make it use text-input-v1 by pass --enable-wayland-ime. <br />
<br />
== Desktop environment ==<br />
=== KDE Plasma ===<br />
* App/Compositor supports text-input-v2 and text-input-v3.<br />
* Comopositor/Application uses zwp_input_method_v1. <br />
* 5.27 additionally supports text-input-v1.<br />
* 5.24 usable zwp_input_method_v1 with fcitx5. Pre-5.24 there are lots of problems, always use fcitx im module instead.<br />
* Use "Virtual keyboard" KCM to launch fcitx5 instead of XDG autostart.<br />
<br />
=== GNOME ===<br />
* Application/Compositor uses text-input-v3<br />
* Compositor/Input Method uses ibus dbus protocol, so ibus frontend is required to be used.<br />
* Adding Fcitx 5 to autostart, it will replace any existing ibus-daemon upon start up so it will work out of box.<br />
* Popup candidate window is not able to be displayed over gnome-shell UI. Only solution is to use [[Special:MyLanguage/Kimpanel|Kimpanel]], [https://extensions.gnome.org/extension/261/kimpanel/ link to extension].<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Sway ===<br />
* Application/Compositor uses text-input-v3<br />
* Comopositor/Application uses zwp_input_method_v2, but it's partially implemented. You will need [https://github.com/swaywm/sway/pull/7226 this pull request] to make it show the popup candidate window for text-input-v3 client.<br />
* fcitx im module also works.<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Weston ===<br />
* Application/Compositor uses text-input-v1<br />
* Comopositor/Application uses zwp_input_method_v1.<br />
* Since it has no text-input-v3, which is more commonly used, im module is the only solution for Gtk/Qt, need to set GTK_IM_MODULE=fcitx and QT_IM_MODULE=fcitx<br />
<br />
== Known Issues ==<br />
=== Fcitx managed XKB layout ===<br />
Unlike X11, there is no generic way to set XKB layout to compositor, which means it can only be implemented for every individual desktop. Right now, Fcitx managed layout only works for KDE Plasma.<br />
<br />
As for non-KDE desktop, in order to make this "semi" work you'll need to ensure following:<br />
<br />
* The system layout in the group should be the same as the actual xkb layout you configured for the compositor.<br />
* Configure only one layout.<br />
* If you need other layout for text typing (e.g. Arabic), just add them to the Fcitx. As long as the key is forwarded to fcitx, it should work.<br />
<br />
=== Popup candidate window ===<br />
Wayland does not have a global coordinate system for regular client, so for native wayland client, it is impossible for Fcitx to place a wayland surface at a certain position. In order for popup window to be placed at the correct position, there are following cases:<br />
* Xwayland have no problem and it should work as good as X11.<br />
* If zwp_input_method protocol can be used, it has a surface role to allow compositor to place the popup window for input method. This only works if client uses text-input protocol.<br />
* For GNOME, kimpanel extension can read window coordinate since it's running inside compositor. As long as im module can report relative coordinate, kimpanel extension can display the popup window at the correct position. As similar approach for Plasma kimpanel is planned, but not yet implemented.<br />
* For Gtk/Qt, fcitx's im module implement a way to render the popup with in the client process. This has some limitation because implemenation of xdg_popup in Gtk3/Qt5 doesn't support reposition the window. So show/hide trick is used to mitigate this, but it may cause window blinking. Fcitx tries not to move window if possible. You may also disable popup animation if you're using KWin to help reduce the blinking.<br />
<br />
=== Per-window input method state ===<br />
When zwp_input_method is used, essentially there is only one input context visible to fcitx, and fcitx cannot distinguish what application is being used. Which means the input method "active"/"inactivate" state is now "global".<br />
<br />
There is planned change to obtain the active application name and use "virtual" input context for wayland frontend. It's not yet in the stable version of Fcitx.</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Using_Fcitx_5_on_Wayland&diff=45418Using Fcitx 5 on Wayland2023-02-22T02:22:06Z<p>Weng Xuetian: /* Sway */</p>
<hr />
<div>[https://wayland.freedesktop.org/ Wayland] is the next generation of display server protocol. While the initial release of the protocol is in 2008, the support of input method is not really ideal.<br />
<br />
Also, using input method on Wayland-based compositor may require different setup to make it work, and certain features of fcitx that works under X11 are not yet supported by Wayland.<br />
<br />
This page will try to cover all the current information with some underlying details, and [[Special:MyLanguage/Setup Fcitx 5|Setup Fcitx 5]] is still generally useful.<br />
<br />
== Applications ==<br />
=== Legacy X11 application that runs under XWayland ===<br />
In a word, XWayland support for input method is as good as normal X11 display server. As long as you set the same environment variable, using Xwayland should not be a issue. This category includes: <br />
<br />
* Xlib-based (and also other toolkit based on Xlib, e.g. tk, SDL1, etc), e.g. xterm, rxvt. Make sure XMODIFIERS is set correctly.<br />
* Gtk2-based applications, similar to Xlib, but can use fcitx im module. Set GTK_IM_MODULE to fcitx will give it best experience.<br />
* SDL2-based applications that doesn't default to wayland. Set SDL_IM_MODULE to fcitx<br />
* electron, chromium, these are still default to X11, similar to Gtk2 case.<br />
* For Qt4 applcation, Qt 4 can only use X11. You will need to QT_IM_MODULE to fcitx. Same for Qt5+ that uses XCB (can be override with QT_QPA_PLATFORM=xcb).<br />
<br />
=== Gtk3 / Gtk4 ===<br />
Gtk3 and Gtk4 support text-input-v3 natively. At the same time, it's also possible to use fcitx im module under wayland. So, either GTK_IM_MODULE=wayland or GTK_IM_MODULE=fcitx works. There are some difference to it. text-input-v3<br />
<br />
=== Qt5 / Qt6 ===<br />
If your Qt application natively runs under Wayland, you can either unset QT_IM_MODULE to make it use text-input-v2, or set QT_IM_MODULE=fcitx to make it use fcitx im module.<br />
<br />
text-input-v2 is not upstreamed to wayland-protocols, that is probably why only kwin support it. This means in non-kwin environment, you will need to use QT_IM_MODULE=fcitx to make the Qt applications work.<br />
<br />
On Qt6, you may also use QT_IM_MODULE= (empty) or QT_IM_MODULE=wayland if your Qt vesion contains this https://codereview.qt-project.org/c/qt/qtwayland/+/416862.<br />
<br />
=== Native wayland application (winit) ===<br />
Most likely text-input-v3 is being used.<br />
<br />
=== Chromium / Electron ===<br />
By default it runs under Xwayland, to make it runs natively under wayland, you can enforce ozone platform to wayland (in some about: or by command line --enable-features=UseOzonePlatform --ozone-platform=wayland).<br />
<br />
It's possible to make it use GTK_IM_MODULE if it runs with Gtk4 (only supported by chromium/chrome at this time, not electron).<br />
<br />
It's also possible to make it use text-input-v1 by pass --enable-wayland-ime. <br />
<br />
== Desktop environment ==<br />
=== KDE Plasma ===<br />
* App/Compositor supports text-input-v2 and text-input-v3.<br />
* Comopositor/Application uses zwp_input_method_v1. <br />
* 5.27 additionally supports text-input-v1.<br />
* 5.24 usable zwp_input_method_v1 with fcitx5. Pre-5.24 there are lots of problems, always use fcitx im module instead.<br />
* Use "Virtual keyboard" KCM to launch fcitx5 instead of XDG autostart.<br />
<br />
=== GNOME ===<br />
* Application/Compositor uses text-input-v3<br />
* Compositor/Input Method uses ibus dbus protocol, so ibus frontend is required to be used.<br />
* Adding Fcitx 5 to autostart, it will replace any existing ibus-daemon upon start up so it will work out of box.<br />
* Popup candidate window is not able to be displayed over gnome-shell UI. Only solution is to use [[Special:MyLanguage/Kimpanel|Kimpanel]], [https://extensions.gnome.org/extension/261/kimpanel/ link to extension].<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Sway ===<br />
* Application/Compositor uses text-input-v3<br />
* Comopositor/Application uses zwp_input_method_v2, but it's partially implemented. You will need [https://github.com/swaywm/sway/pull/7226 this pull request] to make it show the popup candidate window for text-input-v3 client.<br />
* fcitx im module also works.<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Weston ===<br />
* Application/Compositor uses text-input-v1<br />
* Comopositor/Application uses zwp_input_method_v1.<br />
* Since it has no text-input-v3, which is more commonly used, im module is the only solution for Gtk/Qt.<br />
<br />
== Known Issues ==<br />
=== Fcitx managed XKB layout ===<br />
Unlike X11, there is no generic way to set XKB layout to compositor, which means it can only be implemented for every individual desktop. Right now, Fcitx managed layout only works for KDE Plasma.<br />
<br />
As for non-KDE desktop, in order to make this "semi" work you'll need to ensure following:<br />
<br />
* The system layout in the group should be the same as the actual xkb layout you configured for the compositor.<br />
* Configure only one layout.<br />
* If you need other layout for text typing (e.g. Arabic), just add them to the Fcitx. As long as the key is forwarded to fcitx, it should work.<br />
<br />
=== Popup candidate window ===<br />
Wayland does not have a global coordinate system for regular client, so for native wayland client, it is impossible for Fcitx to place a wayland surface at a certain position. In order for popup window to be placed at the correct position, there are following cases:<br />
* Xwayland have no problem and it should work as good as X11.<br />
* If zwp_input_method protocol can be used, it has a surface role to allow compositor to place the popup window for input method. This only works if client uses text-input protocol.<br />
* For GNOME, kimpanel extension can read window coordinate since it's running inside compositor. As long as im module can report relative coordinate, kimpanel extension can display the popup window at the correct position. As similar approach for Plasma kimpanel is planned, but not yet implemented.<br />
* For Gtk/Qt, fcitx's im module implement a way to render the popup with in the client process. This has some limitation because implemenation of xdg_popup in Gtk3/Qt5 doesn't support reposition the window. So show/hide trick is used to mitigate this, but it may cause window blinking. Fcitx tries not to move window if possible. You may also disable popup animation if you're using KWin to help reduce the blinking.<br />
<br />
=== Per-window input method state ===<br />
When zwp_input_method is used, essentially there is only one input context visible to fcitx, and fcitx cannot distinguish what application is being used. Which means the input method "active"/"inactivate" state is now "global".<br />
<br />
There is planned change to obtain the active application name and use "virtual" input context for wayland frontend. It's not yet in the stable version of Fcitx.</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Using_Fcitx_5_on_Wayland&diff=45417Using Fcitx 5 on Wayland2023-02-22T02:21:44Z<p>Weng Xuetian: /* GNOME */</p>
<hr />
<div>[https://wayland.freedesktop.org/ Wayland] is the next generation of display server protocol. While the initial release of the protocol is in 2008, the support of input method is not really ideal.<br />
<br />
Also, using input method on Wayland-based compositor may require different setup to make it work, and certain features of fcitx that works under X11 are not yet supported by Wayland.<br />
<br />
This page will try to cover all the current information with some underlying details, and [[Special:MyLanguage/Setup Fcitx 5|Setup Fcitx 5]] is still generally useful.<br />
<br />
== Applications ==<br />
=== Legacy X11 application that runs under XWayland ===<br />
In a word, XWayland support for input method is as good as normal X11 display server. As long as you set the same environment variable, using Xwayland should not be a issue. This category includes: <br />
<br />
* Xlib-based (and also other toolkit based on Xlib, e.g. tk, SDL1, etc), e.g. xterm, rxvt. Make sure XMODIFIERS is set correctly.<br />
* Gtk2-based applications, similar to Xlib, but can use fcitx im module. Set GTK_IM_MODULE to fcitx will give it best experience.<br />
* SDL2-based applications that doesn't default to wayland. Set SDL_IM_MODULE to fcitx<br />
* electron, chromium, these are still default to X11, similar to Gtk2 case.<br />
* For Qt4 applcation, Qt 4 can only use X11. You will need to QT_IM_MODULE to fcitx. Same for Qt5+ that uses XCB (can be override with QT_QPA_PLATFORM=xcb).<br />
<br />
=== Gtk3 / Gtk4 ===<br />
Gtk3 and Gtk4 support text-input-v3 natively. At the same time, it's also possible to use fcitx im module under wayland. So, either GTK_IM_MODULE=wayland or GTK_IM_MODULE=fcitx works. There are some difference to it. text-input-v3<br />
<br />
=== Qt5 / Qt6 ===<br />
If your Qt application natively runs under Wayland, you can either unset QT_IM_MODULE to make it use text-input-v2, or set QT_IM_MODULE=fcitx to make it use fcitx im module.<br />
<br />
text-input-v2 is not upstreamed to wayland-protocols, that is probably why only kwin support it. This means in non-kwin environment, you will need to use QT_IM_MODULE=fcitx to make the Qt applications work.<br />
<br />
On Qt6, you may also use QT_IM_MODULE= (empty) or QT_IM_MODULE=wayland if your Qt vesion contains this https://codereview.qt-project.org/c/qt/qtwayland/+/416862.<br />
<br />
=== Native wayland application (winit) ===<br />
Most likely text-input-v3 is being used.<br />
<br />
=== Chromium / Electron ===<br />
By default it runs under Xwayland, to make it runs natively under wayland, you can enforce ozone platform to wayland (in some about: or by command line --enable-features=UseOzonePlatform --ozone-platform=wayland).<br />
<br />
It's possible to make it use GTK_IM_MODULE if it runs with Gtk4 (only supported by chromium/chrome at this time, not electron).<br />
<br />
It's also possible to make it use text-input-v1 by pass --enable-wayland-ime. <br />
<br />
== Desktop environment ==<br />
=== KDE Plasma ===<br />
* App/Compositor supports text-input-v2 and text-input-v3.<br />
* Comopositor/Application uses zwp_input_method_v1. <br />
* 5.27 additionally supports text-input-v1.<br />
* 5.24 usable zwp_input_method_v1 with fcitx5. Pre-5.24 there are lots of problems, always use fcitx im module instead.<br />
* Use "Virtual keyboard" KCM to launch fcitx5 instead of XDG autostart.<br />
<br />
=== GNOME ===<br />
* Application/Compositor uses text-input-v3<br />
* Compositor/Input Method uses ibus dbus protocol, so ibus frontend is required to be used.<br />
* Adding Fcitx 5 to autostart, it will replace any existing ibus-daemon upon start up so it will work out of box.<br />
* Popup candidate window is not able to be displayed over gnome-shell UI. Only solution is to use [[Special:MyLanguage/Kimpanel|Kimpanel]], [https://extensions.gnome.org/extension/261/kimpanel/ link to extension].<br />
* Qt need to use QT_IM_MODULE=fcitx since there is no text-input-v2 support.<br />
<br />
=== Sway ===<br />
* Application/Compositor uses text-input-v3<br />
* Comopositor/Application uses zwp_input_method_v2, but it's partially implemented. You will need [https://github.com/swaywm/sway/pull/7226 this pull request] to make it show the popup candidate window for text-input-v3 client.<br />
* fcitx im module also works.<br />
<br />
=== Weston ===<br />
* Application/Compositor uses text-input-v1<br />
* Comopositor/Application uses zwp_input_method_v1.<br />
* Since it has no text-input-v3, which is more commonly used, im module is the only solution for Gtk/Qt.<br />
<br />
== Known Issues ==<br />
=== Fcitx managed XKB layout ===<br />
Unlike X11, there is no generic way to set XKB layout to compositor, which means it can only be implemented for every individual desktop. Right now, Fcitx managed layout only works for KDE Plasma.<br />
<br />
As for non-KDE desktop, in order to make this "semi" work you'll need to ensure following:<br />
<br />
* The system layout in the group should be the same as the actual xkb layout you configured for the compositor.<br />
* Configure only one layout.<br />
* If you need other layout for text typing (e.g. Arabic), just add them to the Fcitx. As long as the key is forwarded to fcitx, it should work.<br />
<br />
=== Popup candidate window ===<br />
Wayland does not have a global coordinate system for regular client, so for native wayland client, it is impossible for Fcitx to place a wayland surface at a certain position. In order for popup window to be placed at the correct position, there are following cases:<br />
* Xwayland have no problem and it should work as good as X11.<br />
* If zwp_input_method protocol can be used, it has a surface role to allow compositor to place the popup window for input method. This only works if client uses text-input protocol.<br />
* For GNOME, kimpanel extension can read window coordinate since it's running inside compositor. As long as im module can report relative coordinate, kimpanel extension can display the popup window at the correct position. As similar approach for Plasma kimpanel is planned, but not yet implemented.<br />
* For Gtk/Qt, fcitx's im module implement a way to render the popup with in the client process. This has some limitation because implemenation of xdg_popup in Gtk3/Qt5 doesn't support reposition the window. So show/hide trick is used to mitigate this, but it may cause window blinking. Fcitx tries not to move window if possible. You may also disable popup animation if you're using KWin to help reduce the blinking.<br />
<br />
=== Per-window input method state ===<br />
When zwp_input_method is used, essentially there is only one input context visible to fcitx, and fcitx cannot distinguish what application is being used. Which means the input method "active"/"inactivate" state is now "global".<br />
<br />
There is planned change to obtain the active application name and use "virtual" input context for wayland frontend. It's not yet in the stable version of Fcitx.</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Using_Fcitx_5_on_Wayland&diff=45416Using Fcitx 5 on Wayland2023-02-22T02:21:13Z<p>Weng Xuetian: /* Qt5 / Qt6 */</p>
<hr />
<div>[https://wayland.freedesktop.org/ Wayland] is the next generation of display server protocol. While the initial release of the protocol is in 2008, the support of input method is not really ideal.<br />
<br />
Also, using input method on Wayland-based compositor may require different setup to make it work, and certain features of fcitx that works under X11 are not yet supported by Wayland.<br />
<br />
This page will try to cover all the current information with some underlying details, and [[Special:MyLanguage/Setup Fcitx 5|Setup Fcitx 5]] is still generally useful.<br />
<br />
== Applications ==<br />
=== Legacy X11 application that runs under XWayland ===<br />
In a word, XWayland support for input method is as good as normal X11 display server. As long as you set the same environment variable, using Xwayland should not be a issue. This category includes: <br />
<br />
* Xlib-based (and also other toolkit based on Xlib, e.g. tk, SDL1, etc), e.g. xterm, rxvt. Make sure XMODIFIERS is set correctly.<br />
* Gtk2-based applications, similar to Xlib, but can use fcitx im module. Set GTK_IM_MODULE to fcitx will give it best experience.<br />
* SDL2-based applications that doesn't default to wayland. Set SDL_IM_MODULE to fcitx<br />
* electron, chromium, these are still default to X11, similar to Gtk2 case.<br />
* For Qt4 applcation, Qt 4 can only use X11. You will need to QT_IM_MODULE to fcitx. Same for Qt5+ that uses XCB (can be override with QT_QPA_PLATFORM=xcb).<br />
<br />
=== Gtk3 / Gtk4 ===<br />
Gtk3 and Gtk4 support text-input-v3 natively. At the same time, it's also possible to use fcitx im module under wayland. So, either GTK_IM_MODULE=wayland or GTK_IM_MODULE=fcitx works. There are some difference to it. text-input-v3<br />
<br />
=== Qt5 / Qt6 ===<br />
If your Qt application natively runs under Wayland, you can either unset QT_IM_MODULE to make it use text-input-v2, or set QT_IM_MODULE=fcitx to make it use fcitx im module.<br />
<br />
text-input-v2 is not upstreamed to wayland-protocols, that is probably why only kwin support it. This means in non-kwin environment, you will need to use QT_IM_MODULE=fcitx to make the Qt applications work.<br />
<br />
On Qt6, you may also use QT_IM_MODULE= (empty) or QT_IM_MODULE=wayland if your Qt vesion contains this https://codereview.qt-project.org/c/qt/qtwayland/+/416862.<br />
<br />
=== Native wayland application (winit) ===<br />
Most likely text-input-v3 is being used.<br />
<br />
=== Chromium / Electron ===<br />
By default it runs under Xwayland, to make it runs natively under wayland, you can enforce ozone platform to wayland (in some about: or by command line --enable-features=UseOzonePlatform --ozone-platform=wayland).<br />
<br />
It's possible to make it use GTK_IM_MODULE if it runs with Gtk4 (only supported by chromium/chrome at this time, not electron).<br />
<br />
It's also possible to make it use text-input-v1 by pass --enable-wayland-ime. <br />
<br />
== Desktop environment ==<br />
=== KDE Plasma ===<br />
* App/Compositor supports text-input-v2 and text-input-v3.<br />
* Comopositor/Application uses zwp_input_method_v1. <br />
* 5.27 additionally supports text-input-v1.<br />
* 5.24 usable zwp_input_method_v1 with fcitx5. Pre-5.24 there are lots of problems, always use fcitx im module instead.<br />
* Use "Virtual keyboard" KCM to launch fcitx5 instead of XDG autostart.<br />
<br />
=== GNOME ===<br />
* Application/Compositor uses text-input-v3<br />
* Compositor/Input Method uses ibus dbus protocol, so ibus frontend is required to be used.<br />
* Adding Fcitx 5 to autostart, it will replace any existing ibus-daemon upon start up so it will work out of box.<br />
* Popup candidate window is not able to be displayed over gnome-shell UI. Only solution is to use [[Special:MyLanguage/Kimpanel|Kimpanel]], [https://extensions.gnome.org/extension/261/kimpanel/ link to extension].<br />
<br />
=== Sway ===<br />
* Application/Compositor uses text-input-v3<br />
* Comopositor/Application uses zwp_input_method_v2, but it's partially implemented. You will need [https://github.com/swaywm/sway/pull/7226 this pull request] to make it show the popup candidate window for text-input-v3 client.<br />
* fcitx im module also works.<br />
<br />
=== Weston ===<br />
* Application/Compositor uses text-input-v1<br />
* Comopositor/Application uses zwp_input_method_v1.<br />
* Since it has no text-input-v3, which is more commonly used, im module is the only solution for Gtk/Qt.<br />
<br />
== Known Issues ==<br />
=== Fcitx managed XKB layout ===<br />
Unlike X11, there is no generic way to set XKB layout to compositor, which means it can only be implemented for every individual desktop. Right now, Fcitx managed layout only works for KDE Plasma.<br />
<br />
As for non-KDE desktop, in order to make this "semi" work you'll need to ensure following:<br />
<br />
* The system layout in the group should be the same as the actual xkb layout you configured for the compositor.<br />
* Configure only one layout.<br />
* If you need other layout for text typing (e.g. Arabic), just add them to the Fcitx. As long as the key is forwarded to fcitx, it should work.<br />
<br />
=== Popup candidate window ===<br />
Wayland does not have a global coordinate system for regular client, so for native wayland client, it is impossible for Fcitx to place a wayland surface at a certain position. In order for popup window to be placed at the correct position, there are following cases:<br />
* Xwayland have no problem and it should work as good as X11.<br />
* If zwp_input_method protocol can be used, it has a surface role to allow compositor to place the popup window for input method. This only works if client uses text-input protocol.<br />
* For GNOME, kimpanel extension can read window coordinate since it's running inside compositor. As long as im module can report relative coordinate, kimpanel extension can display the popup window at the correct position. As similar approach for Plasma kimpanel is planned, but not yet implemented.<br />
* For Gtk/Qt, fcitx's im module implement a way to render the popup with in the client process. This has some limitation because implemenation of xdg_popup in Gtk3/Qt5 doesn't support reposition the window. So show/hide trick is used to mitigate this, but it may cause window blinking. Fcitx tries not to move window if possible. You may also disable popup animation if you're using KWin to help reduce the blinking.<br />
<br />
=== Per-window input method state ===<br />
When zwp_input_method is used, essentially there is only one input context visible to fcitx, and fcitx cannot distinguish what application is being used. Which means the input method "active"/"inactivate" state is now "global".<br />
<br />
There is planned change to obtain the active application name and use "virtual" input context for wayland frontend. It's not yet in the stable version of Fcitx.</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Using_Fcitx_5_on_Wayland&diff=45415Using Fcitx 5 on Wayland2023-02-21T01:50:12Z<p>Weng Xuetian: </p>
<hr />
<div>[https://wayland.freedesktop.org/ Wayland] is the next generation of display server protocol. While the initial release of the protocol is in 2008, the support of input method is not really ideal.<br />
<br />
Also, using input method on Wayland-based compositor may require different setup to make it work, and certain features of fcitx that works under X11 are not yet supported by Wayland.<br />
<br />
This page will try to cover all the current information with some underlying details, and [[Special:MyLanguage/Setup Fcitx 5|Setup Fcitx 5]] is still generally useful.<br />
<br />
== Applications ==<br />
=== Legacy X11 application that runs under XWayland ===<br />
In a word, XWayland support for input method is as good as normal X11 display server. As long as you set the same environment variable, using Xwayland should not be a issue. This category includes: <br />
<br />
* Xlib-based (and also other toolkit based on Xlib, e.g. tk, SDL1, etc), e.g. xterm, rxvt. Make sure XMODIFIERS is set correctly.<br />
* Gtk2-based applications, similar to Xlib, but can use fcitx im module. Set GTK_IM_MODULE to fcitx will give it best experience.<br />
* SDL2-based applications that doesn't default to wayland. Set SDL_IM_MODULE to fcitx<br />
* electron, chromium, these are still default to X11, similar to Gtk2 case.<br />
* For Qt4 applcation, Qt 4 can only use X11. You will need to QT_IM_MODULE to fcitx. Same for Qt5+ that uses XCB (can be override with QT_QPA_PLATFORM=xcb).<br />
<br />
=== Gtk3 / Gtk4 ===<br />
Gtk3 and Gtk4 support text-input-v3 natively. At the same time, it's also possible to use fcitx im module under wayland. So, either GTK_IM_MODULE=wayland or GTK_IM_MODULE=fcitx works. There are some difference to it. text-input-v3<br />
<br />
=== Qt5 / Qt6 ===<br />
If your Qt application natively runs under Wayland, you can either unset QT_IM_MODULE to make it use text-input-v2, or set QT_IM_MODULE=fcitx to make it use fcitx im module.<br />
<br />
On Qt6, you may also use QT_IM_MODULE= (empty) or QT_IM_MODULE=wayland if your Qt vesion contains this https://codereview.qt-project.org/c/qt/qtwayland/+/416862.<br />
<br />
=== Native wayland application (winit) ===<br />
Most likely text-input-v3 is being used.<br />
<br />
=== Chromium / Electron ===<br />
By default it runs under Xwayland, to make it runs natively under wayland, you can enforce ozone platform to wayland (in some about: or by command line --enable-features=UseOzonePlatform --ozone-platform=wayland).<br />
<br />
It's possible to make it use GTK_IM_MODULE if it runs with Gtk4 (only supported by chromium/chrome at this time, not electron).<br />
<br />
It's also possible to make it use text-input-v1 by pass --enable-wayland-ime. <br />
<br />
== Desktop environment ==<br />
=== KDE Plasma ===<br />
* App/Compositor supports text-input-v2 and text-input-v3.<br />
* Comopositor/Application uses zwp_input_method_v1. <br />
* 5.27 additionally supports text-input-v1.<br />
* 5.24 usable zwp_input_method_v1 with fcitx5. Pre-5.24 there are lots of problems, always use fcitx im module instead.<br />
* Use "Virtual keyboard" KCM to launch fcitx5 instead of XDG autostart.<br />
<br />
=== GNOME ===<br />
* Application/Compositor uses text-input-v3<br />
* Compositor/Input Method uses ibus dbus protocol, so ibus frontend is required to be used.<br />
* Adding Fcitx 5 to autostart, it will replace any existing ibus-daemon upon start up so it will work out of box.<br />
* Popup candidate window is not able to be displayed over gnome-shell UI. Only solution is to use [[Special:MyLanguage/Kimpanel|Kimpanel]], [https://extensions.gnome.org/extension/261/kimpanel/ link to extension].<br />
<br />
=== Sway ===<br />
* Application/Compositor uses text-input-v3<br />
* Comopositor/Application uses zwp_input_method_v2, but it's partially implemented. You will need [https://github.com/swaywm/sway/pull/7226 this pull request] to make it show the popup candidate window for text-input-v3 client.<br />
* fcitx im module also works.<br />
<br />
=== Weston ===<br />
* Application/Compositor uses text-input-v1<br />
* Comopositor/Application uses zwp_input_method_v1.<br />
* Since it has no text-input-v3, which is more commonly used, im module is the only solution for Gtk/Qt.<br />
<br />
== Known Issues ==<br />
=== Fcitx managed XKB layout ===<br />
Unlike X11, there is no generic way to set XKB layout to compositor, which means it can only be implemented for every individual desktop. Right now, Fcitx managed layout only works for KDE Plasma.<br />
<br />
As for non-KDE desktop, in order to make this "semi" work you'll need to ensure following:<br />
<br />
* The system layout in the group should be the same as the actual xkb layout you configured for the compositor.<br />
* Configure only one layout.<br />
* If you need other layout for text typing (e.g. Arabic), just add them to the Fcitx. As long as the key is forwarded to fcitx, it should work.<br />
<br />
=== Popup candidate window ===<br />
Wayland does not have a global coordinate system for regular client, so for native wayland client, it is impossible for Fcitx to place a wayland surface at a certain position. In order for popup window to be placed at the correct position, there are following cases:<br />
* Xwayland have no problem and it should work as good as X11.<br />
* If zwp_input_method protocol can be used, it has a surface role to allow compositor to place the popup window for input method. This only works if client uses text-input protocol.<br />
* For GNOME, kimpanel extension can read window coordinate since it's running inside compositor. As long as im module can report relative coordinate, kimpanel extension can display the popup window at the correct position. As similar approach for Plasma kimpanel is planned, but not yet implemented.<br />
* For Gtk/Qt, fcitx's im module implement a way to render the popup with in the client process. This has some limitation because implemenation of xdg_popup in Gtk3/Qt5 doesn't support reposition the window. So show/hide trick is used to mitigate this, but it may cause window blinking. Fcitx tries not to move window if possible. You may also disable popup animation if you're using KWin to help reduce the blinking.<br />
<br />
=== Per-window input method state ===<br />
When zwp_input_method is used, essentially there is only one input context visible to fcitx, and fcitx cannot distinguish what application is being used. Which means the input method "active"/"inactivate" state is now "global".<br />
<br />
There is planned change to obtain the active application name and use "virtual" input context for wayland frontend. It's not yet in the stable version of Fcitx.</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Fcitx_5/zh-cn&diff=45414Fcitx 5/zh-cn2023-02-19T23:55:39Z<p>Weng Xuetian: </p>
<hr />
<div><languages/><br />
<br />
小企鹅输入法(Fcitx 读作[ˈfaɪtɪks])是一个支持扩展的输入法框架。目前,它支持Linux操作系统,以及如freebsd这样的Unix操作系统。Fcitx 通过使用各种各样的输入法引擎来支持全世界大量不同种类的语言。<br />
<br />
Fcitx本身的核心实现非常简单,它通过使用插件来提供强大的功能。fcitx可以非常容易的进行定制以满足不同的个性化需求。<br />
<br />
[[Special:myLanguage/Fcitx|导航至旧版的 Fcitx 4 Wiki页面?]]<br />
<br />
==== 用户 ====<br />
<br />
* [[Special:myLanguage/Install Fcitx 5|如何安装 Fcitx 5]]<br />
* [[Special:myLanguage/Input method engines|支持Fcitx5的输入法引擎]]<br />
* 安装 [[Special:myLanguage/Input method engines|输入法引擎]]<br />
* [[Special:myLanguage/Theme Customization|定制您的输入法主题]]<br />
* [[Special:myLanguage/FAQ|常见问题]]<br />
* [[Special:myLanguage/Using Fcitx 5 on Wayland|在 Wayland 上使用 Fcitx 5]]<br />
<br />
==== 开发者 ====<br />
<br />
* [[Special:myLanguage/Compiling fcitx5|如何编译 fcitx5]]<br />
* [[Special:myLanguage/Basic concept|基本概念]]<br />
* [[Special:myLanguage/Develop an simple input method|如何开发一个简单的输入法]]<br />
* [[Special:myLanguage/Q&A for developer|开发者常见问题与解答]]<br />
* [[Special:myLanguage/Debug fcitx5|调试 fcitx5]]<br />
<br />
==== 新闻 ====<br />
<br />
<rss max=5>https://politepol.com/fd/hhM5BOjZLblk</rss><br />
<br />
== 如何帮助 Fcitx ==<br />
* 给你的朋友推荐Fcitx输入法<br />
* [[Special:myLanguage/Report Bug|报告漏洞]]<br />
* [[Special:myLanguage/Contribute to this Wiki|为Wiki做贡献]] ('''请在申请你的帐号之前仔细阅读此页面''')<br />
* [[Special:myLanguage/Donate|捐助]]<br />
<br />
== 关于 ==<br />
* [[Special:myLanguage/History|Fcitx的历史]]</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Translations:Fcitx_5/5/zh-cn&diff=45413Translations:Fcitx 5/5/zh-cn2023-02-19T23:55:39Z<p>Weng Xuetian: </p>
<hr />
<div>* [[Special:myLanguage/Install Fcitx 5|如何安装 Fcitx 5]]<br />
* [[Special:myLanguage/Input method engines|支持Fcitx5的输入法引擎]]<br />
* 安装 [[Special:myLanguage/Input method engines|输入法引擎]]<br />
* [[Special:myLanguage/Theme Customization|定制您的输入法主题]]<br />
* [[Special:myLanguage/FAQ|常见问题]]<br />
* [[Special:myLanguage/Using Fcitx 5 on Wayland|在 Wayland 上使用 Fcitx 5]]</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Using_Fcitx_5_on_Wayland&diff=45409Using Fcitx 5 on Wayland2023-02-19T23:46:28Z<p>Weng Xuetian: </p>
<hr />
<div>[https://wayland.freedesktop.org/ Wayland] is the next generation of display server protocol. While the initial release of the protocol is in 2008, the support of input method is not really ideal.<br />
<br />
Also, using input method on Wayland-based compositor may require different setup to make it work, and certain features of fcitx that works under X11 are not yet supported by Wayland.<br />
<br />
This page will try to cover all the current information with some underlying details, and [[Special:MyLanguage/Setup Fcitx 5|Setup Fcitx 5]] is still generally useful.<br />
<br />
== Applications ==<br />
=== Legacy X11 application that runs under XWayland ===<br />
In a word, XWayland support for input method is as good as normal X11 display server. As long as you set the same environment variable, using Xwayland should not be a issue. This category includes: <br />
<br />
* Xlib-based (and also other toolkit based on Xlib, e.g. tk, SDL1, etc), e.g. xterm, rxvt. Make sure XMODIFIERS is set correctly.<br />
* Gtk2-based applications, similar to Xlib, but can use fcitx im module. Set GTK_IM_MODULE to fcitx will give it best experience.<br />
* SDL2-based applications that doesn't default to wayland. Set SDL_IM_MODULE to fcitx<br />
* electron, chromium, these are still default to X11, similar to Gtk2 case.<br />
* For Qt4 applcation, Qt 4 can only use X11. You will need to QT_IM_MODULE to fcitx. Same for Qt5+ that uses XCB (can be override with QT_QPA_PLATFORM=xcb).<br />
<br />
=== Gtk3 / Gtk4 ===<br />
Gtk3 and Gtk4 support text-input-v3 natively. At the same time, it's also possible to use fcitx im module under wayland. So, either GTK_IM_MODULE=wayland or GTK_IM_MODULE=fcitx works. There are some difference to it. text-input-v3<br />
<br />
=== Qt5 / Qt6 ===<br />
If your Qt application natively runs under Wayland, you can either unset QT_IM_MODULE to make it use text-input-v2, or set QT_IM_MODULE=fcitx to make it use fcitx im module.<br />
<br />
On Qt6, you may also use QT_IM_MODULE= (empty) or QT_IM_MODULE=wayland if your Qt vesion contains this https://codereview.qt-project.org/c/qt/qtwayland/+/416862.<br />
<br />
=== Native wayland application (winit) ===<br />
Most likely text-input-v3 is being used.<br />
<br />
=== Chromium / Electron ===<br />
By default it runs under Xwayland, to make it runs natively under wayland, you can enforce ozone platform to wayland (in some about: or by command line --enable-features=UseOzonePlatform --ozone-platform=wayland).<br />
<br />
It's possible to make it use GTK_IM_MODULE if it runs with Gtk4 (only supported by chromium/chrome at this time, not electron).<br />
<br />
It's also possible to make it use text-input-v1 by pass --enable-wayland-ime. <br />
<br />
== Desktop environment ==<br />
=== KDE Plasma ===<br />
* App/Compositor supports text-input-v2 and text-input-v3.<br />
* Comopositor/Application uses zwp_input_method_v1. <br />
* 5.27 additionally supports text-input-v1.<br />
* 5.24 usable zwp_input_method_v1 with fcitx5. Pre-5.24 there are lots of problems, always use fcitx im module instead.<br />
* Use "Virtual keyboard" KCM to launch fcitx5 instead of XDG autostart.<br />
<br />
=== GNOME ===<br />
* Application/Compositor uses text-input-v3<br />
* Compositor/Input Method uses ibus dbus protocol, so ibus frontend is required to be used.<br />
* Adding Fcitx 5 to autostart, it will replace any existing ibus-daemon upon start up so it will work out of box.<br />
* Popup candidate window is not able to be displayed over gnome-shell UI. Only solution is to use [[Special:MyLanguage/Kimpanel|Kimpanel]], [https://extensions.gnome.org/extension/261/kimpanel/ link to extension].<br />
<br />
=== Sway ===<br />
* Application/Compositor uses text-input-v3<br />
* Comopositor/Application uses zwp_input_method_v2, but it's partially implemented. You will need [https://github.com/swaywm/sway/pull/7226 this pull request] to make it show the popup candidate window for text-input-v3 client.<br />
* fcitx im module also works.<br />
<br />
=== Weston ===<br />
* Application/Compositor uses text-input-v1<br />
* Comopositor/Application uses zwp_input_method_v1.<br />
* Since it has no text-input-v3, which is more commonly used, im module is the only solution for Gtk/Qt.</div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Fcitx_5&diff=45408Fcitx 52023-02-19T23:46:05Z<p>Weng Xuetian: </p>
<hr />
<div><languages/><br />
<translate><br />
<br />
<!--T:1--><br />
Fcitx [ˈfaɪtɪks] is an input method framework with extension support. Currently it supports Linux and Unix systems like freebsd. Fcitx supports typing with many languages all over the world with a large number of engines.<br />
<br />
<!--T:2--><br />
Fcitx has a slim core while provides powerful features with addons. It is easy to customize fcitx to satisfy your own needs.<br />
<br />
<!--T:3--><br />
[[Special:myLanguage/Fcitx|Looking for Old Wiki Page for Fcitx 4?]]<br />
<br />
==== For Users ==== <!--T:4--><br />
<br />
<!--T:5--><br />
* [[Special:myLanguage/Install Fcitx 5|Install Fcitx 5]]<br />
* [[Special:myLanguage/Setup Fcitx 5|Setup Fcitx 5]]<br />
* Install [[Special:myLanguage/Input method engines|Input method engines]]<br />
* [[Special:myLanguage/Theme Customization|Theme Customization]]<br />
* [[Special:myLanguage/FAQ|FAQ]]<br />
* [[Special:myLanguage/Using Fcitx 5 on Wayland|Using Fcitx 5 on Wayland]]<br />
<br />
==== For Developers ==== <!--T:6--><br />
<br />
<!--T:7--><br />
* [[Special:myLanguage/Compiling fcitx5|Compiling fcitx5]]<br />
* [[Special:myLanguage/Basic concept|Basic concept]]<br />
* [[Special:myLanguage/Develop an simple input method|Develop an simple input method]]<br />
* [[Special:myLanguage/Q&A for developer|Q&A for developer]]<br />
* [[Special:myLanguage/Debug fcitx5|Debug fcitx5]]<br />
<br />
==== News ==== <!--T:8--><br />
<br />
<!--T:9--><br />
<rss max=5>https://politepol.com/fd/hhM5BOjZLblk</rss><br />
<br />
== Help Fcitx == <!--T:10--><br />
* Recommend Fcitx to your friend<br />
* [[Special:myLanguage/Report Bug|Report Bug]]<br />
* [[Special:myLanguage/Contribute to this Wiki|Contribute to this Wiki]] ('''Please read this before you request account''')<br />
* [[Special:myLanguage/Donate|Donate]]<br />
<br />
== About Fcitx == <!--T:11--><br />
* [[Special:myLanguage/History|History]]<br />
<br />
</translate></div>Weng Xuetianhttps://fcitx-im.org/index.php?title=Using_Fcitx_5_on_Wayland&diff=45407Using Fcitx 5 on Wayland2023-02-19T23:45:16Z<p>Weng Xuetian: </p>
<hr />
<div>[https://wayland.freedesktop.org/ Wayland] is the next generation of display server protocol. While the initial release of the protocol is in 2008, the support of input method is not really ideal.<br />
<br />
Also, using input method on Wayland-based compositor may require different setup to make it work, and certain features of fcitx that works under X11 are not yet supported by Wayland.<br />
<br />
This page will try to cover all the current information with some underlying details, and [[Special:MyLanguage/Setup Fcitx 5]] is still generally useful.<br />
<br />
== Applications ==<br />
=== Legacy X11 application that runs under XWayland ===<br />
In a word, XWayland support for input method is as good as normal X11 display server. As long as you set the same environment variable, using Xwayland should not be a issue. This category includes: <br />
<br />
* Xlib-based (and also other toolkit based on Xlib, e.g. tk, SDL1, etc), e.g. xterm, rxvt. Make sure XMODIFIERS is set correctly.<br />
* Gtk2-based applications, similar to Xlib, but can use fcitx im module. Set GTK_IM_MODULE to fcitx will give it best experience.<br />
* SDL2-based applications that doesn't default to wayland. Set SDL_IM_MODULE to fcitx<br />
* electron, chromium, these are still default to X11, similar to Gtk2 case.<br />
* For Qt4 applcation, Qt 4 can only use X11. You will need to QT_IM_MODULE to fcitx. Same for Qt5+ that uses XCB (can be override with QT_QPA_PLATFORM=xcb).<br />
<br />
=== Gtk3 / Gtk4 ===<br />
Gtk3 and Gtk4 support text-input-v3 natively. At the same time, it's also possible to use fcitx im module under wayland. So, either GTK_IM_MODULE=wayland or GTK_IM_MODULE=fcitx works. There are some difference to it. text-input-v3<br />
<br />
=== Qt5 / Qt6 ===<br />
If your Qt application natively runs under Wayland, you can either unset QT_IM_MODULE to make it use text-input-v2, or set QT_IM_MODULE=fcitx to make it use fcitx im module.<br />
<br />
On Qt6, you may also use QT_IM_MODULE= (empty) or QT_IM_MODULE=wayland if your Qt vesion contains this https://codereview.qt-project.org/c/qt/qtwayland/+/416862.<br />
<br />
=== Native wayland application (winit) ===<br />
Most likely text-input-v3 is being used.<br />
<br />
=== Chromium / Electron ===<br />
By default it runs under Xwayland, to make it runs natively under wayland, you can enforce ozone platform to wayland (in some about: or by command line --enable-features=UseOzonePlatform --ozone-platform=wayland).<br />
<br />
It's possible to make it use GTK_IM_MODULE if it runs with Gtk4 (only supported by chromium/chrome at this time, not electron).<br />
<br />
It's also possible to make it use text-input-v1 by pass --enable-wayland-ime. <br />
<br />
== Desktop environment ==<br />
=== KDE Plasma ===<br />
* App/Compositor supports text-input-v2 and text-input-v3.<br />
* Comopositor/Application uses zwp_input_method_v1. <br />
* 5.27 additionally supports text-input-v1.<br />
* 5.24 usable zwp_input_method_v1 with fcitx5. Pre-5.24 there are lots of problems, always use fcitx im module instead.<br />
* Use "Virtual keyboard" KCM to launch fcitx5 instead of XDG autostart.<br />
<br />
=== GNOME ===<br />
* Application/Compositor uses text-input-v3<br />
* Compositor/Input Method uses ibus dbus protocol, so ibus frontend is required to be used.<br />
* Adding Fcitx 5 to autostart, it will replace any existing ibus-daemon upon start up so it will work out of box.<br />
* Popup candidate window is not able to be displayed over gnome-shell UI. Only solution is to use [[Special:MyLanguage/Kimpanel|Kimpanel]], [https://extensions.gnome.org/extension/261/kimpanel/ link to extension].<br />
<br />
=== Sway ===<br />
* Application/Compositor uses text-input-v3<br />
* Comopositor/Application uses zwp_input_method_v2, but it's partially implemented. You will need [https://github.com/swaywm/sway/pull/7226 this pull request] to make it show the popup candidate window for text-input-v3 client.<br />
* fcitx im module also works.<br />
<br />
=== Weston ===<br />
* Application/Compositor uses text-input-v1<br />
* Comopositor/Application uses zwp_input_method_v1.<br />
* Since it has no text-input-v3, which is more commonly used, im module is the only solution for Gtk/Qt.</div>Weng Xuetian