fcitx / fcitx5

maybe a new fcitx.
1.6k stars 118 forks source link

当焦点在 Chrome、Electron 时重启 fcitx5,会导致 Chrome、Electron 不能打开任何菜单 #960

Closed antonchen closed 8 months ago

antonchen commented 8 months ago

环境比较复杂,我目前不能确定是哪个的问题。 目前同样的环境使用 ibus-rime 没有问题。实际上我准备从 ibus-rime 换到 fcitx5-rime,使用了一会出现了这个问题。

表现出的情况是:Chrome、Electron 中的菜单会因为 fcitx5-rime 或 fcitx5 影响导致打不开(一闪而过),包括不限于菜单栏,Chrome 书签栏,右键菜单。 不能判定触发条件,正常使用十来分钟就会出问题。切换 bspwm 桌面或打开新窗口后,出问题的程序会恢复正常。退出 fcitx5 也会恢复。

我的环境: Debian testing bspwm + picom fcitx5 5.1.7-1 fcitx5-rime 5.1.4-1

Xorg -version

X.Org X Server 1.21.1.10
X Protocol Version 11, Revision 0
Current Operating System: Linux AntonPC.local 6.2.12-x64v3-xanmod1 #0~20230420.98e6d2d9 SMP PREEMPT_DYNAMIC Thu Apr 20 23:08:51 UTC x86_64
Kernel command line: root=LABEL=Root rootflags=subvol=@ rw hibernate=nocompress libata.noacpi=1 quiet initrd=\@\initrd.img
xorg-server 2:21.1.10-1 (https://www.debian.org/support) 
Current version of pixman: 0.42.2
    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.

Rime 配置:https://github.com/iDvel/rime-ice

我本机受影响的程序是 Google Chrome、VSCode

wengxt commented 8 months ago

什么的菜单

wengxt commented 8 months ago

请贴 fcitx5-diagnose 的输出

wengxt commented 8 months ago

重启 chromium 的时候能恢复吗

antonchen commented 8 months ago

什么的菜单

包括不限于菜单栏,Chrome书签栏,右键菜单。

请贴 fcitx5-diagnose 的输出

fcitx5-diagnose # System Info: 1. `uname -a`: Linux AntonPC.local 6.2.12-x64v3-xanmod1 #0~20230420.98e6d2d9 SMP PREEMPT_DYNAMIC Thu Apr 20 23:08:51 UTC x86_64 GNU/Linux 2. `lsb_release -a`: Distributor ID: Debian Description: Debian GNU/Linux trixie/sid Release: n/a Codename: trixie 3. `lsb_release -d`: Description: Debian GNU/Linux trixie/sid 4. `/etc/lsb-release`: `/etc/lsb-release` not found. 5. `/etc/os-release`: PRETTY_NAME="Debian GNU/Linux trixie/sid" NAME="Debian GNU/Linux" VERSION_CODENAME=trixie ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/" 6. Desktop Environment: Cannot determine desktop environment. 7. XDG SESSION TYPE: XDG_SESSION_TYPE='x11' 8. Bash Version: BASH_VERSION='5.2.21(1)-release' # Environment: 1. DISPLAY: DISPLAY=':0' WAYLAND_DISPLAY='' 2. Keyboard Layout: 1. `setxkbmap`: 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)" }; }; 2. `xprop`: _XKB_RULES_NAMES(STRING) = "evdev", "pc105", "us", "", "" 3. Locale: 1. All locales: C C.utf8 en_US.utf8 POSIX zh_CN.utf8 2. Current locale: LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_CTYPE=zh_CN.UTF-8 LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL= 4. Directories: 1. Home: /home/anton 2. `${XDG_CONFIG_HOME}`: Environment variable `XDG_CONFIG_HOME` is not set. Current value of `XDG_CONFIG_HOME` is `~/.config` (`/home/anton/.config`). 3. Fcitx5 Settings Directory: Current fcitx5 settings directory is `~/.config/fcitx5` (`/home/anton/.config/fcitx5`). 5. Current user: The script is run as anton (1000). # Fcitx State: 1. executable: Found fcitx5 at `/usr/bin/fcitx5`. 2. version: Fcitx version: `5.1.7` 3. process: Found 1 fcitx5 process: 1464 fcitx5 4. `fcitx5-remote`: `fcitx5-remote` works properly. 5. DBus interface: Using `dbus-send` to check dbus. Owner of DBus name `org.fcitx.Fcitx5` is `:1.37`. PID of DBus name `org.fcitx.Fcitx5` owner is `1464`. Debug information from dbus: Group [x11::0] has 11 InputContext(s) IC [4c71bac50f024020958c5939e0524c43] program:code frontend:dbus cap:6000000032 focus:0 IC [139386aae3994def922418a08e63950d] program:thunderbird-default frontend:dbus cap:6000000032 focus:0 IC [298795468fd745df81d43b906ee9d3ca] program: frontend:ibus cap:12 focus:1 IC [37a85c65fe0b47708717d06b345210dd] program:google-chrome-stable frontend:dbus cap:6000000032 focus:0 IC [1bba0c09894f4e518c5da2f689f38616] program:thunderbird-default frontend:dbus cap:6000000032 focus:0 IC [a7246b93bee9424297818f56a679bd9d] program:thunderbird-default frontend:dbus cap:6000000032 focus:0 IC [08823d17829a43eab4fe7a8b6d9aef38] program:org.remmina.Remmina frontend:dbus cap:6000040072 focus:0 IC [86cbb29987494455bd9c6ffdd0e9fe8c] program:telegram-desktop frontend:dbus cap:6800800072 focus:0 IC [d9a07085869f4f63833e938a51e16971] program:thunderbird-default frontend:dbus cap:6000000032 focus:0 IC [49711d21d95044edba574522654733a8] program:spotube frontend:dbus cap:6000000072 focus:0 IC [b5425e29db8c4359931a095b52060693] program:copyq frontend:dbus cap:6000800072 focus:0 Input Context without group # Fcitx Configure UI: 1. Config Tool Wrapper: Found fcitx5-configtool at `/usr/bin/fcitx5-configtool`. 2. Config GUI for qt: Found `fcitx5-config-qt` at `/usr/bin/fcitx5-config-qt`. 3. Config GUI for kde: **`kcmshell5` not found.** # 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: 1. `${XMODIFIERS}`: Environment variable XMODIFIERS is set to "@im=fcitx" correctly. Xim Server Name from Environment variable is fcitx. 2. XIM_SERVERS on root window: Xim server name is the same with that set in the environment variable. ## Qt: 1. qt4 - `${QT4_IM_MODULE}`: Environment variable QT_IM_MODULE is set to "fcitx" correctly. **`fcitx5-qt4-immodule-probing` not found.** 2. 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: QT_QPA_PLATFORM=xcb QT_IM_MODULE=fcitx IM_MODULE_CLASSNAME=fcitx::QFcitxPlatformInputContext 3. 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_QPA_PLATFORM=xcb QT_IM_MODULE=fcitx IM_MODULE_CLASSNAME=fcitx::QFcitxPlatformInputContext 4. Qt IM module files: Found fcitx5 im module for qt5: `/usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so`. Found fcitx5 im module for qt6: `/usr/lib/x86_64-linux-gnu/qt6/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so`. Found fcitx5 qt6 module: `/usr/lib/x86_64-linux-gnu/fcitx5/qt6/libfcitx-quickphrase-editor5.so`. 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.** ## Gtk: 1. 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 2. `gtk-query-immodules`: 1. gtk 2: **Cannot find `gtk-query-immodules` for gtk 2** **Cannot find fcitx5 im module for gtk 2.** 2. gtk 3: **Cannot find `gtk-query-immodules` for gtk 3** **Cannot find fcitx5 im module for gtk 3.** 3. Gtk IM module cache: 1. gtk 2: **Cannot find immodules cache for gtk 2** **Cannot find fcitx5 im module for gtk 2 in cache.** 2. gtk 3: Found immodules cache for gtk `3.24.40` at `/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules.cache`. Version Line: # Created by /usr/lib/x86_64-linux-gnu/libgtk-3-0/gtk-query-immodules-3.0 from gtk+-3.24.40 Found fcitx5 im modules for gtk `3.24.40`. "/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules/im-fcitx5.so" "fcitx" "Fcitx5 (Flexible Input Method Framework5)" "fcitx5" "/usr/locale" "ja:ko:zh:*" "fcitx5" "Fcitx5 (Flexible Input Method Framework5)" "fcitx5" "/usr/locale" "ja:ko:zh:*" 4. Gtk IM module files: 1. gtk 2: All found Gtk 2 immodule files exist. 2. gtk 3: All found Gtk 3 immodule files exist. 3. gtk 4: All found Gtk 4 immodule files exist. # Configuration: ## Fcitx Addons: 1. Addon Config Dir: Found fcitx5 addon config directory: `/usr/share/fcitx5/addon`. 2. Addon List: 1. Found 21 enabled addons: Classic User Interface 5.1.7 Clipboard 5.1.7 DBus 5.1.7 DBus Frontend 5.1.7 Emoji 5.1.7 Fcitx4 Frontend 5.1.7 IBus Frontend 5.1.7 Input method selector 5.1.7 Keyboard 5.1.7 KDE Input Method Panel 5.1.7 Status Notifier 5.1.7 Notification 5.1.7 Quick Phrase 5.1.7 Rime 5.1.4 Spell 5.1.7 Unicode 5.1.7 DBus Virtual Keyboard 5.1.7 Wayland 5.1.7 Wayland Input method frontend 5.1.7 XCB 5.1.7 X Input Method Frontend 5.1.7 2. Found 0 disabled addons: 3. Addon Libraries: All libraries for all addons are found. 4. User Interface: Found 3 enabled user interface addons: Classic User Interface KDE Input Method Panel DBus Virtual Keyboard ## Input Methods: 1. `/home/anton/.config/fcitx5/profile`: [Groups/0] # Group Name Name=默认 # Layout Default Layout=us # Default Input Method DefaultIM=rime [Groups/0/Items/0] # Name Name=keyboard-us # Layout Layout= [Groups/0/Items/1] # Name Name=rime # Layout Layout= [GroupOrder] 0=默认 # Log: 1. `date`: Sun Jan 28 11:22:45 AM CST 2024 2. `/home/anton/.config/fcitx5/crash.log`: `/home/anton/.config/fcitx5/crash.log` not found. **Warning: the output of fcitx5-diagnose contains sensitive information, including the distribution name, kernel version, name of currently running programs, etc.** **Though such information can be helpful to developers for diagnostic purpose, please double check and remove as necessary before posting it online publicly.**

重启 chromium 的时候能恢复吗

不需要重启就能恢复,当然重启也能恢复,切换 bspwm 桌面或打开新窗口后导致出问题的窗口大小变化(平铺wm),出问题的程序会恢复正常。退出 fcitx5 也会恢复。

我怀疑菜单一闪而过是什么导致焦点丢失。

wengxt commented 8 months ago

@antonchen 如果我什么都不干,光挂机,可以重现吗 听起来如果需要重现我基本啥也不能干也不能切换虚拟桌面,也不能启动新的程序

antonchen commented 8 months ago

@antonchen 如果我什么都不干,光挂机,可以重现吗 听起来如果需要重现我基本啥也不能干也不能切换虚拟桌面,也不能启动新的程序

不需要,正常使用就能重现,可能我右键菜单用得比较频繁才发现的。我目前重现也不是很稳定。 我重装完之后以为好了,一会儿就鼠标右键一下,还是重现了一次。

antonchen commented 8 months ago

我找到了稳定复现的方法,在 Chrome、Electron 激活 Rime 后通过 fcitx5 菜单重启 fcitx5 就会出问题(输入候选框都会一闪而过),焦点脱离 Chrome、Electron 就会恢复。

其它程序没有这个现象如:TelegramDesktop、Remmina 试过,不存在问题。 发现问题时我刚好在调试、编辑配置频繁重启,没有注意到这个动作。

------ EDIT ------ 当 fcitx5 处于「键盘 - 英语(美国)」时,这个问题同样存在,也许这是上游 fcitx5 的问题。

----- EDIT ------ Rime 执行「重新部署」和 「同步」也可以复现。

wengxt commented 8 months ago

试试 master branch

hantengc commented 8 months ago

@antonchen 这个一闪而过的问题我在我们系统上遇到过

antonchen commented 8 months ago

试试 master branch

测试了,已修复。