fcitx / fcitx5

maybe a new fcitx.
1.57k stars 117 forks source link

Input issues after upgrading fcitx 5.1.9 #1044

Closed typester closed 3 months ago

typester commented 4 months ago

Summary

After upgrading fcitx to version 5.1.9, I can no longer input Japanese characters. English input works, but it feels unstable, as if some keystrokes are being missed.

I am unsure how to investigate this issue further since I don't have much information, but an interesting behavior occurs when focusing on the Firefox address bar: the input field redraws repeatedly without any input from me. This might offer a clue in resolving the issue.

My environment is as follows:

Operating System: Arch Linux
Window Manager: River WM (Wayland)
Input Method: fcitx5 with fcitx-skk

Steps to Reproduce

  1. Upgrade fcitx from version 5.1.8 to 5.1.9
  2. Attempt to input Japanese Characters with SKK backend or type normally in any input field.
  3. Focus on the Firefox address bar to observe the redrawing issue.

Expected Behavior

I expect to be able to input both English and Japanese without any issues, just as it was possible in version 5.1.8.

Output of fcitx5-diagnose command

System Info:

  1. uname -a:

    Linux karas 6.8.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 02 May 2024 17:49:46 +0000 x86_64 GNU/Linux
  2. lsb_release -a:

    LSB Version:    n/a
    Distributor ID: Arch
    Description:    Arch Linux
    Release:    rolling
    Codename:   n/a
  3. lsb_release -d:

    Description:    Arch Linux
  4. /etc/lsb-release:

    DISTRIB_ID="Arch"
    DISTRIB_RELEASE="rolling"
    DISTRIB_DESCRIPTION="Arch Linux"
  5. /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
  6. Desktop Environment:

    Cannot determine desktop environment.

  7. XDG SESSION TYPE:

    XDG_SESSION_TYPE='wayland'
  8. 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
      ja_JP.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/typester
    2. ${XDG_CONFIG_HOME}:

      Environment variable XDG_CONFIG_HOME is not set.

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

    3. Fcitx5 Settings Directory:

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

  5. Current user:

    The script is run as typester (1000).

Fcitx State:

  1. executable:

    Found fcitx5 at /usr/bin/fcitx5.

  2. version:

    Fcitx version: 5.1.9

  3. process:

    Found 1 fcitx5 process:

       4611 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.46.

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

    Debug information from dbus:

       Group [wayland:] has 2 InputContext(s)
      IC [46c2b1bb7635489c8f68581c9d91dcff] program:Alacritty frontend:wayland_v2 cap:100000072 focus:1
      IC [c856ce99dd984f0c96a5b9af4043ea64] program: frontend:wayland_v2 cap:100000072 focus:0
    Group [x11::1] has 0 InputContext(s)
    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.

  3. XIM for Emacs:

    Your LC_CTYPE is set to en_US.UTF-8 instead of one of zh, ja, ko. You may not be able to use input method in emacs because of an really old emacs bug that upstream refuse to fix for years.

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=wayland
    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=wayland
    QT_IM_MODULE=fcitx
    IM_MODULE_CLASSNAME=fcitx::QFcitxPlatformInputContext
  4. Qt IM module files:

    Found fcitx5 im module for qt: /usr/lib/qt/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. Found fcitx5 qt6 module: /usr/lib/fcitx5/qt6/libfcitx5-skk-config.so. Found fcitx5 im module for qt6: /usr/lib/qt6/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so. Found unknown fcitx qt module: /usr/lib/qt6/plugins/plasma/kcms/systemsettings/kcm_fcitx5.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.

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

    GTK_IM_MODULE=fcitx

    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:

      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.41 at /usr/bin/gtk-query-immodules-3.0. Version Line:

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

      Found fcitx5 im modules for gtk 3.24.41.

      "/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.41 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.41

      Found fcitx5 im modules for gtk 3.24.41.

      "/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 21 enabled addons:

      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
      SKK 5.1.2
      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/typester/.config/fcitx5/profile:

    [Groups/0]
    # Group Name
    Name=Default
    # Layout
    Default Layout=us
    # Default Input Method
    DefaultIM=keyboard-us
    
    [Groups/0/Items/0]
    # Name
    Name=skk
    # Layout
    Layout=
    
    [Groups/0/Items/1]
    # Name
    Name=keyboard-us
    # Layout
    Layout=
    
    [GroupOrder]
    0=Default

Log:

  1. date:

    Mon May  6 01:44:25 PM PDT 2024
  2. /home/typester/.config/fcitx5/crash.log:

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

wengxt commented 4 months ago

Looks like riverwm has similar issue like https://github.com/swaywm/sway/issues/8143

gdluca commented 4 months ago

Just wanted to add a quick comment that I have the same issue with swaywm. Thanks for looking into this.

typester commented 4 months ago

I hadn't considered that this issue is related to riverwm, so thank you for the info.

Out of curiosity, I also tested this issue on Hyprland, and found that it worked without any problems. JFYI.

I will raise an issue with riverwm as well.

mhiuuu commented 4 months ago

Well sorry about this but also experiencing this issue in Hyprland 0.40.0 and fcitx5 5.1.10 / 5.1.9. After using everything normally for 20 minutes or an hour, the fcitx5 input starts to behave weirdly: Normally when you want to change the input languages in the input field you press "Ctrl+Space" and there will be a small box tells you what language you have just changed to but it just flys to the top right corner with a very little small white square and now you will only be able to use English. Also when u killall fcitx5 It crashes

wengxt commented 4 months ago

@typester I reverted the commit that triggers this on fcitx master, you can try master see if it helps

ToolmanP commented 4 months ago

Same here, i'm using Hyprland and seems like the windows focus is pretty messed up here. When my mouse has already moved away from one window to another but the input method turns out to be still focused on the previously active window. Not Sure what's going on here.

wengxt commented 4 months ago

hyprland issue is fixed on hyprland master

OriginCode commented 4 months ago

@typester I reverted the commit that triggers this on fcitx master, you can try master see if it helps

Tested working on swaywm with the revert commit patch.

stevenhuang226 commented 4 months ago

similar issue on sway-im(aur) input filed keep redraw but chinese-input(fcitx5-chewing) work fine

ifreund commented 4 months ago

I believe the issue with river should be fixed by https://codeberg.org/river/river/pulls/1064. Testing with affected fctix versions would be much appreciated though.

wengxt commented 4 months ago

@ifreund thanks, while I believe your fix the message loop, but I also wonder if you need to sync the wl_keyboard's keymap / modifier state as replacement.

basically, zwp_virtual_keyboard require to send an alternative keymap to wl_keyboard (fcitx doesn't, fcitx just re-send what it get from keyboard_grab, but you shouldn't assume that). So when virtual keyboard is destroyed, I believe you should resend keymap and modifiers

ifreund commented 4 months ago

@ifreund thanks, while I believe your fix the message loop, but I also wonder if you need to sync the wl_keyboard's keymap / modifier state as replacement.

basically, zwp_virtual_keyboard require to send an alternative keymap to wl_keyboard (fcitx doesn't, fcitx just re-send what it get from keyboard_grab, but you shouldn't assume that). So when virtual keyboard is destroyed, I believe you should resend keymap and modifiers

In theory river should already be doing that, it at least has code that's intended to do so. Do you have logs of river's master branch doing something different?

yanorei32 commented 3 months ago

Tested working on sway on master branch too! Thank you.

Operating System: Arch Linux Window Manager: sway 1.9-3 (Wayland) Input Method: fcitx5, fcitx5-mozc 2.29.5268.102-1

wengxt commented 3 months ago

https://github.com/swaywm/sway/issues/8143