You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Wayland (Hyprland), I use KMonad (https://github.com/kmonad/kmonad) to rebind some keys on my keyboard to sequence of key events. For example, rebind tab key to ctrl-z (which is, "left ctrl down", "z down", "z up", "left ctrl up", without any delay inbetween). Sometimes in some programs they simply receives z key event without modifier key (ctrl) applied.
I have seen this bug happen various programs: chromium (native wayland), Qt programs (XWayland), xev, and alacritty. But not able to repro on gedit (wayland mode) and wev. When it happens, it's 100% reproducible on all the programs that's vulnerable, even after restarting fcitx.
I think it likely is a fcitx issue as the bug immediately disappears if I shutdown fcitx, and reappear after lunching fcitx again. It could also potentially be a bug of Hyprland though.
I believe it's a race condition as the bug can be workaround by inserting 5ms delay between key events (tap-macro (press-only lctl) z (release-only lctl) :delay 5).
Here is a trace of wl_keyboard events on alacritty when the bug happen:
WARNING: Running setxkbmap against an Xwayland server
xkb_keymap {
xkb_keycodes { include "evdev+aliases(qwerty)" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols { include "pc+us+inet(evdev)" };
xkb_geometry { include "pc(pc105)" };
};
Environment variable XDG_CONFIG_HOME is set to /home/user/.config.
Current value of XDG_CONFIG_HOME is ~/.config (/home/user/.config).
Fcitx5 Settings Directory:
Current fcitx5 settings directory is ~/.config/fcitx5 (/home/user/.config/fcitx5).
Current user:
The script is run as user (1000).
Fcitx State:
executable:
Found fcitx5 at /etc/profiles/per-user/user/bin/fcitx5.
version:
Fcitx version: 5.1.12
process:
Found 1 fcitx5 process:
4068 .fcitx5-wrapped
fcitx5-remote:
fcitx5-remote works properly.
DBus interface:
Using dbus-send to check dbus.
Owner of DBus name org.fcitx.Fcitx5 is :1.14.
PID of DBus name org.fcitx.Fcitx5 owner is 4068.
Debug information from dbus:
<redacted>
Input Context without group
Frontends setup:
The environment variable checked by this script only shows the environment under current shell. It is still possible that you did not set the environment to the whole graphic desktop session. You may inspect the actual environment variable of a certain process by using xargs -0 -L1 /proc/$PID/environ for a certain process that you find not working.
Xim:
${XMODIFIERS}:
Environment variable XMODIFIERS is set to "@im=fcitx" correctly.
Xim Server Name from Environment variable is fcitx.
XIM_SERVERS on root window:
Xim server name is the same with that set in the environment variable.
Qt:
qt4 - ${QT4_IM_MODULE}:
Environment variable QT_IM_MODULE is set to "fcitx" correctly.
fcitx5-qt4-immodule-probing not found.
qt5 - ${QT_IM_MODULE}:
Environment variable QT_IM_MODULE is set to "fcitx" correctly.
Using fcitx5-qt5-immodule-probing to check the actual im module to be used under current environment:
Following error may not be accurate because guessing Qt version from path depends on how your distribution packages Qt. It is not a critical error if you do not use any Qt application with certain version of Qt or you are using text-input support by Qt under Wayland. Cannot find fcitx5 input method module for Qt4. Cannot find fcitx5 input method module for Qt5. Cannot find fcitx5 input method module for Qt6.
Gtk:
gtk - ${GTK_IM_MODULE}:
Environment variable GTK_IM_MODULE is set to "fcitx" correctly.
fcitx5-gtk2-immodule-probing not found.
Using fcitx5-gtk3-immodule-probing to check the actual im module to be used under current environment:
GTK_IM_MODULE=fcitx
Using fcitx5-gtk4-immodule-probing to check the actual im module to be used under current environment:
GTK_IM_MODULE=fcitx
gtk-query-immodules:
gtk 2:
Cannot find gtk-query-immodules for gtk 2
Cannot find fcitx5 im module for gtk 2.
gtk 3:
Cannot find gtk-query-immodules for gtk 3
Cannot find fcitx5 im module for gtk 3.
Gtk IM module cache:
gtk 2:
Cannot find immodules cache for gtk 2
Cannot find fcitx5 im module for gtk 2 in cache.
gtk 3:
Cannot find immodules cache for gtk 3
Cannot find fcitx5 im module for gtk 3 in cache.
Gtk IM module files:
gtk 2:
All found Gtk 2 immodule files exist.
gtk 3:
All found Gtk 3 immodule files exist.
gtk 4:
All found Gtk 4 immodule files exist.
Configuration:
Fcitx Addons:
Addon Config Dir:
Found fcitx5 addon config directory: /nix/store/h2c7l00j9w4c6cvn2s8gf9i81dbcc74i-fcitx5-5.1.12/share/fcitx5/addon.
Summary
On Wayland (Hyprland), I use KMonad (https://github.com/kmonad/kmonad) to rebind some keys on my keyboard to sequence of key events. For example, rebind tab key to ctrl-z (which is, "left ctrl down", "z down", "z up", "left ctrl up", without any delay inbetween). Sometimes in some programs they simply receives z key event without modifier key (ctrl) applied.
I have seen this bug happen various programs: chromium (native wayland), Qt programs (XWayland), xev, and alacritty. But not able to repro on gedit (wayland mode) and wev. When it happens, it's 100% reproducible on all the programs that's vulnerable, even after restarting fcitx.
I think it likely is a fcitx issue as the bug immediately disappears if I shutdown fcitx, and reappear after lunching fcitx again. It could also potentially be a bug of Hyprland though.
I believe it's a race condition as the bug can be workaround by inserting 5ms delay between key events
(tap-macro (press-only lctl) z (release-only lctl) :delay 5)
.Here is a trace of wl_keyboard events on alacritty when the bug happen:
The program does receive key down / key up events in correct order, but
mods_depressed
is not updated properly.Steps to Reproduce
#(C-z)
in KMonad).Expected Behavior
Modifier key is applied correctly
Output of fcitx5-diagnose command
System Info:
uname -a
:lsb_release
:lsb_release
not found./etc/lsb-release
:/etc/os-release
:Desktop Environment:
Cannot determine desktop environment.
XDG SESSION TYPE:
Bash Version:
Environment:
DISPLAY:
Keyboard Layout:
setxkbmap
:xprop
:Locale:
All locales:
Current locale:
Directories:
Home:
${XDG_CONFIG_HOME}
:Environment variable
XDG_CONFIG_HOME
is set to/home/user/.config
.Current value of
XDG_CONFIG_HOME
is~/.config
(/home/user/.config
).Fcitx5 Settings Directory:
Current fcitx5 settings directory is
~/.config/fcitx5
(/home/user/.config/fcitx5
).Current user:
The script is run as user (1000).
Fcitx State:
executable:
Found fcitx5 at
/etc/profiles/per-user/user/bin/fcitx5
.version:
Fcitx version:
5.1.12
process:
Found 1 fcitx5 process:
fcitx5-remote
:fcitx5-remote
works properly.DBus interface:
Using
dbus-send
to check dbus.Owner of DBus name
org.fcitx.Fcitx5
is:1.14
.PID of DBus name
org.fcitx.Fcitx5
owner is4068
.Debug information from dbus:
Frontends setup:
The environment variable checked by this script only shows the environment under current shell. It is still possible that you did not set the environment to the whole graphic desktop session. You may inspect the actual environment variable of a certain process by using
xargs -0 -L1 /proc/$PID/environ
for a certain process that you find not working.Xim:
${XMODIFIERS}
:Environment variable XMODIFIERS is set to "@im=fcitx" correctly.
Xim Server Name from Environment variable is fcitx.
XIM_SERVERS on root window:
Xim server name is the same with that set in the environment variable.
Qt:
qt4 -
${QT4_IM_MODULE}
:Environment variable QT_IM_MODULE is set to "fcitx" correctly.
fcitx5-qt4-immodule-probing
not found.qt5 -
${QT_IM_MODULE}
:Environment variable QT_IM_MODULE is set to "fcitx" correctly.
Using fcitx5-qt5-immodule-probing to check the actual im module to be used under current environment:
qt6 -
${QT_IM_MODULE}
:Environment variable QT_IM_MODULE is set to "fcitx" correctly.
Using fcitx5-qt6-immodule-probing to check the actual im module to be used under current environment:
Qt IM module files:
Following error may not be accurate because guessing Qt version from path depends on how your distribution packages Qt. It is not a critical error if you do not use any Qt application with certain version of Qt or you are using text-input support by Qt under Wayland.
Cannot find fcitx5 input method module for Qt4.
Cannot find fcitx5 input method module for Qt5.
Cannot find fcitx5 input method module for Qt6.
Gtk:
gtk -
${GTK_IM_MODULE}
:Environment variable GTK_IM_MODULE is set to "fcitx" correctly.
fcitx5-gtk2-immodule-probing
not found.Using fcitx5-gtk3-immodule-probing to check the actual im module to be used under current environment:
Using fcitx5-gtk4-immodule-probing to check the actual im module to be used under current environment:
gtk-query-immodules
:gtk 2:
Cannot find
gtk-query-immodules
for gtk 2Cannot find fcitx5 im module for gtk 2.
gtk 3:
Cannot find
gtk-query-immodules
for gtk 3Cannot find fcitx5 im module for gtk 3.
Gtk IM module cache:
gtk 2:
Cannot find immodules cache for gtk 2
Cannot find fcitx5 im module for gtk 2 in cache.
gtk 3:
Cannot find immodules cache for gtk 3
Cannot find fcitx5 im module for gtk 3 in cache.
Gtk IM module files:
gtk 2:
All found Gtk 2 immodule files exist.
gtk 3:
All found Gtk 3 immodule files exist.
gtk 4:
All found Gtk 4 immodule files exist.
Configuration:
Fcitx Addons:
Addon Config Dir:
Found fcitx5 addon config directory:
/nix/store/h2c7l00j9w4c6cvn2s8gf9i81dbcc74i-fcitx5-5.1.12/share/fcitx5/addon
.Addon List:
Found 20 enabled addons:
Found 0 disabled addons:
Addon Libraries:
All libraries for all addons are found.
User Interface:
Found 3 enabled user interface addons:
Input Methods:
/home/user/.config/fcitx5/profile
:Log:
date
:/home/user/.config/fcitx5/crash.log
:/home/user/.config/fcitx5/crash.log
not found.The text was updated successfully, but these errors were encountered: