fcitx / fcitx5

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

候選字界面跑到視窗左上方,無法輸入中文 #1067

Open tsoua2 opened 4 months ago

tsoua2 commented 4 months ago

Summary

有的程式不支持中文輸入。 目前碰到的是:google-chrome, spotify, obsidian 以下是我的配置

os: arch linux 6.9.2
gui: hyprland 0.40.0
rime: fcitx5-rime 5.1.6-1
fcitx5: 5.1.9-1

/etc/environment 配置

XIM="fcitx"
XMODIFIERS=@im=fcitx
SDL_IM_MODULE=fcitx
INPUT_METHOD=fcitx
GLFW_IM_MODULE=ibus

Steps to Reproduce

Switch IME in the input area

Expected Behavior

Can input Chinese

Output of fcitx5-diagnose command

System Info:

  1. uname -a:

    Linux arch 6.9.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Sun, 26 May 2024 01:30:29 +0000 x86_64 GNU/Linux
  2. lsb_release:

    lsb_release not found.

  3. /etc/lsb-release:

    /etc/lsb-release not found.

  4. /etc/os-release:

    NAME="Arch Linux"
    PRETTY_NAME="Arch Linux"
    ID=arch
    BUILD_ID=rolling
    ANSI_COLOR="38;2;23;147;209"
    HOME_URL="https://archlinux.org/"
    DOCUMENTATION_URL="https://wiki.archlinux.org/"
    SUPPORT_URL="https://bbs.archlinux.org/"
    BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues"
    PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
    LOGO=archlinux-logo
  5. Desktop Environment:

    Cannot determine desktop environment.

  6. XDG SESSION TYPE:

    XDG_SESSION_TYPE='wayland'
  7. Bash Version:

    BASH_VERSION='5.2.26(1)-release'

Environment:

  1. DISPLAY:

    DISPLAY=':1'
    
    WAYLAND_DISPLAY='wayland-1'
  2. Keyboard Layout:

    1. setxkbmap:

      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)" };
      };
    2. xprop:

      _XKB_RULES_NAMES(STRING) = "evdev", "pc105", "us", "", ""
  3. Locale:

    1. All locales:

      C
      C.utf8
      en_US.utf8
      POSIX
    2. Current locale:

      LANG=en_US.UTF-8
      LC_CTYPE="en_US.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/father
    2. ${XDG_CONFIG_HOME}:

      Environment variable XDG_CONFIG_HOME is not set.

      Current value of XDG_CONFIG_HOME is ~/.config (/home/father/.config).

    3. Fcitx5 Settings Directory:

      Current fcitx5 settings directory is ~/.config/fcitx5 (/home/father/.config/fcitx5).

  5. Current user:

    The script is run as father (1000).

Fcitx State:

  1. executable:

    Found fcitx5 at /usr/bin/fcitx5.

  2. version:

    Fcitx version: 5.1.9

  3. process:

    Found 1 fcitx5 process:

       1757 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.21.

    PID of DBus name org.fcitx.Fcitx5 owner is 1757.

    Debug information from dbus:

       Group [wayland:] has 5 InputContext(s)
      IC [a45c732cc5c049299446228ae5518237] program:kitty frontend:wayland_v2 cap:100000072 focus:1
      IC [8b0ce914739c4b709858034d996ccebb] program:obsidian frontend:wayland_v2 cap:100000072 focus:0
      IC [f33d72d0177142bb8d7ae4773188b276] program:Google-chrome frontend:wayland_v2 cap:100000072 focus:0
      IC [67a93dd5f7394374949aa54ce221070e] program:Google-chrome frontend:wayland_v2 cap:100000072 focus:0
      IC [8164351f339f456989c4e95f8e03cef3] program: frontend:wayland_v2 cap:100000072 focus:0
    Group [x11::1] has 3 InputContext(s)
      IC [7602d17060fb4dc2a3e7890c04eddee8] program:electron frontend:dbus cap:6000000032 focus:0
      IC [c1e50ba490544b60b69828b5ae7b062f] program:google-chrome frontend:dbus cap:6000000032 focus:0
      IC [0a5ae534dff14db4a76afce8ebd89ff8] program:google-chrome frontend:dbus cap:6000000032 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}:

    Please set environment variable QT_IM_MODULE to "fcitx" using the tool your distribution provides or add export QT_IM_MODULE=fcitx to your ~/.xprofile. See Input Method Related Environment Variables: QT_IM_MODULE.

    fcitx5-qt4-immodule-probing not found.

  2. qt5 - ${QT_IM_MODULE}:

    Please set environment variable QT_IM_MODULE to "fcitx" using the tool your distribution provides or add export QT_IM_MODULE=fcitx to your ~/.xprofile. See Input Method Related Environment Variables: QT_IM_MODULE.

    It is OK to use qt5 built-in Wayland im module if your compositor fully supports text-input protocol used by qt5.

    Using fcitx5-qt5-immodule-probing to check the actual im module to be used under current environment:

    QT_QPA_PLATFORM=xcb
    QT_IM_MODULE=
    IM_MODULE_CLASSNAME=QComposeInputContext
  3. qt6 - ${QT_IM_MODULE}:

    Please set environment variable QT_IM_MODULE to "fcitx" using the tool your distribution provides or add export QT_IM_MODULE=fcitx to your ~/.xprofile. See Input Method Related Environment Variables: QT_IM_MODULE.

    It is OK to use qt6 built-in Wayland im module if your compositor fully supports text-input protocol used by qt6.

    Using fcitx5-qt6-immodule-probing to check the actual im module to be used under current environment:

    QT_QPA_PLATFORM=wayland
    QT_IM_MODULE=
    IM_MODULE_CLASSNAME=QtWaylandClient::QWaylandInputContext
  4. Qt IM module files:

    Found fcitx5 im module for qt: /usr/lib/qt/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so. Found unknown fcitx qt module: /usr/lib/qt6/plugins/plasma/kcms/systemsettings/kcm_fcitx5.so. Found fcitx5 im module for qt6: /usr/lib/qt6/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so. Found fcitx5 qt5 module: /usr/lib/fcitx5/qt5/libfcitx-quickphrase-editor5.so. Found fcitx5 qt6 module: /usr/lib/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}:

    Please set environment variable GTK_IM_MODULE to "fcitx" using the tool your distribution provides or add export GTK_IM_MODULE=fcitx to your ~/.xprofile. See Input Method Related Environment Variables: GTK_IM_MODULE.

    It is OK to use gtk built-in Wayland im module if your compositor fully supports text-input protocol used by gtk.

    Using fcitx5-gtk2-immodule-probing to check the actual im module to be used under current environment:

    GTK_IM_MODULE=fcitx5

    Using fcitx5-gtk3-immodule-probing to check the actual im module to be used under current environment:

    GTK_IM_MODULE=wayland

    Using fcitx5-gtk4-immodule-probing to check the actual im module to be used under current environment:

    GTK_IM_MODULE=wayland
  2. gtk-query-immodules:

    1. gtk 2:

      Found gtk-query-immodules for gtk 2.24.33 at /usr/bin/gtk-query-immodules-2.0. Version Line:

      # Created by /usr/bin/gtk-query-immodules-2.0 from gtk+-2.24.33

      Found fcitx5 im modules for gtk 2.24.33.

      "/usr/lib/gtk-2.0/2.10.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:*" 
    2. gtk 3:

      Found gtk-query-immodules for gtk 3.24.42 at /usr/bin/gtk-query-immodules-3.0. Version Line:

      # Created by /usr/bin/gtk-query-immodules-3.0 from gtk+-3.24.42

      Found fcitx5 im modules for gtk 3.24.42.

      "/usr/lib/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:*" 
  3. Gtk IM module cache:

    1. gtk 2:

      Found immodules cache for gtk 2.24.33 at /usr/lib/gtk-2.0/2.10.0/immodules.cache. Version Line:

      # Created by /usr/bin/gtk-query-immodules-2.0 from gtk+-2.24.33

      Found fcitx5 im modules for gtk 2.24.33.

      "/usr/lib/gtk-2.0/2.10.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:*" 
    2. gtk 3:

      Found immodules cache for gtk 3.24.42 at /usr/lib/gtk-3.0/3.0.0/immodules.cache. Version Line:

      # Created by /usr/bin/gtk-query-immodules-3.0 from gtk+-3.24.42

      Found fcitx5 im modules for gtk 3.24.42.

      "/usr/lib/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 22 enabled addons:

      Chewing 5.1.3
      Classic User Interface 5.1.9
      Clipboard 5.1.9
      DBus 5.1.9
      DBus Frontend 5.1.9
      Emoji 5.1.9
      Fcitx4 Frontend 5.1.9
      IBus Frontend 5.1.9
      Input method selector 5.1.9
      Keyboard 5.1.9
      KDE Input Method Panel 5.1.9
      Status Notifier 5.1.9
      Notification 5.1.9
      Quick Phrase 5.1.9
      Rime 5.1.6
      Spell 5.1.9
      Unicode 5.1.9
      DBus Virtual Keyboard 5.1.9
      Wayland 5.1.9
      Wayland Input method frontend 5.1.9
      XCB 5.1.9
      X Input Method Frontend 5.1.9
    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/father/.config/fcitx5/profile:

    [Groups/0]
    # Group Name
    Name=Default
    # 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=Default

Log:

  1. date:

    Thu May 30 03:51:08 PM CST 2024
  2. /home/father/.config/fcitx5/crash.log:

    /home/father/.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.

Asthestarsfalll commented 4 months ago

same here

LibreGML commented 4 months ago

我的解决方法: 降级 hyprland 到 39.9 版本,亲测有效

我之前的现象:在 hyprland 0.40.0,我必须要点击 waybar 的 fcitx5 图标,才能正常输入一种语言,比如我现在能输入中文了,那么我用快捷键切换到英文,fcitx5 的托盘就会飘到窗口左上方,这时候 如果我想输入英文,就必须要点击 waybar 的 fcitx5 图标,再用快捷键切换到英文才能正常输入英文,当然,中文也是一样。

我感觉我应该去 hyprland 提一下这个 issue,我认为是 hyprland 的问题,绝不是 fcitx5 的问题

Methos: I had the same problem. I solved it by downgrading hyprland to 39.9

Phenomenon: before resolve this problem, my problem was that everything except the terminal could not be typed properly, whether in English or Chinese. I must manually click on the Desktop Menu Bar fcitx5 icon to switch the language, and then can work in a odd way, Because I can only enter a language, if you want to use the shortcut key to switch to Chinese, it will float to the upper left of the window, if this time I can only enter Chinese, with the shortcut key to switch to English, will float to the upper left of the window, so switch language must click on the tray fcitx5 icon to switch 。

in shrot: you can only enter one language at a time. You can't switch with the shortcut key, or the tray will float to the top left. You must manually click the Desktop Menu Bar fcitx5 icon.

Methods I have tried:/ etc / environment and gtk.conf are configured according to archwiki and have no effect.

tsoua2 commented 4 months ago

我的解决方法: 降级 hyprland 到 39.9 版本,亲测有效

我之前的现象:在 hyprland 0.40.0,我必须要点击 waybar 的 fcitx5 图标,才能正常输入一种语言,比如我现在能输入中文了,那么我用快捷键切换到英文,fcitx5 的托盘就会飘到窗口左上方,这时候 如果我想输入英文,就必须要点击 waybar 的 fcitx5 图标,再用快捷键切换到英文才能正常输入英文,当然,中文也是一样。

我感觉我应该去 hyprland 提一下这个 issue,我认为是 hyprland 的问题,绝不是 fcitx5 的问题

Methos: I had the same problem. I solved it by downgrading hyprland to 39.9

Phenomenon: before resolve this problem, my problem was that everything except the terminal could not be typed properly, whether in English or Chinese. I must manually click on the Desktop Menu Bar fcitx5 icon to switch the language, and then can work in a odd way, Because I can only enter a language, if you want to use the shortcut key to switch to Chinese, it will float to the upper left of the window, if this time I can only enter Chinese, with the shortcut key to switch to English, will float to the upper left of the window, so switch language must click on the tray fcitx5 icon to switch 。

in shrot: you can only enter one language at a time. You can't switch with the shortcut key, or the tray will float to the top left. You must manually click the Desktop Menu Bar fcitx5 icon.

Methods I have tried:/ etc / environment and gtk.conf are configured according to archwiki and have no effect.

It's a great workaround, but I quit of further troubleshooting. I switched to Firefox and ALMOST solved the problem. IME only failed on other software time to time.

Thanks for the reply, if someone use fcitx5-rime in Arch Linux like me; I suggest to try this RIME config, somehow it makes my IME more stable or just my personal experience.

sonnycalcr commented 3 weeks ago

我的桌面环境是 hyprland 0.43.0。系统中没有添加任何有关 fcitx5 的相关环境配置。相反,我是通过开启应用的 wayland 支持来使其可以支持输入法的。

比如,我通过在 ~/.config 目录下添加一个 chrome-flags.conf 文件,并在其中写入:

--enable-features=UseOzonePlatform
--ozone-platform=wayland
--enable-wayland-ime

这样就可以让 chrome 支持 fcitx5 输入法了。

对于 obsidian 这种我不知道该如何添加 flags 的应用,我是直接新建了一个用户的 desktop files,比如,我在 ~.local/share/applications 目录下新建了一个 obsidian.desktop 文件,在其中写入:

[Desktop Entry]
Name=Obsidian
Exec=/usr/bin/obsidian %U --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime
Terminal=false
Type=Application
Icon=obsidian
StartupWMClass=obsidian
Comment=Obsidian
MimeType=x-scheme-handler/obsidian;
Categories=Office;

然后,关闭所有正在运行的 obsidian 程序,然后重启即可。如果您使用 wofi,记得,得用 drun 选项启动,不可以使用 run 选项,如果使用 run 选项,也可以解决,但是得添加另外的参数。

更多内容可以看下我的 dotfiles: https://github.com/fanlumaster/dotfiles