fcitx / fcitx5

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

Not work on wayland native applications on Wayfire compositor #621

Closed Piroro-hs closed 1 year ago

Piroro-hs commented 1 year ago

Describe the bug Fcitx5 does not work in wayland native applications such as alacritty or wezterm. Maybe due to Wayfire's lack of support but it looks like supporting zwp_text_input_manager_v3 and zwp_input_method_manager_v2. Fcitx5 works on GTK or Qt applications with appropriate im modules installed.

To Reproduce Steps to reproduce the behavior:

  1. Open wayland native applications such as alacritty or wezterm
  2. Try to activate the fcitx5 and type something

Expected behavior Fcitx5 composes input text, without showing a candidate list popup as wayfire does not support zwp_input_popup_surface_v2.

Actual behavior Just typed text is shown and other than nothing had happened.

Desktop:

System Info:

  1. uname -a:

    Linux pc 5.19.13-arch1-1.1 #1 SMP PREEMPT_DYNAMIC Wed, 05 Oct 2022 07:37:04 +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://bugs.archlinux.org/"
    LOGO=archlinux-logo
  5. Desktop Environment:

    Cannot determine desktop environment.

  6. XDG SESSION TYPE:

    XDG_SESSION_TYPE='wayland'
  7. Bash Version:

    BASH_VERSION='5.1.16(1)-release'

Environment:

  1. DISPLAY:

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

    1. setxkbmap:

      setxkbmap not found.

    2. xprop:

      xprop:  unable to open display ''
  3. Locale:

    1. All locales:

      C
      C.UTF-8
      POSIX
      ja_JP.utf8
    2. Current locale:

      LANG=ja_JP.UTF-8
      LC_CTYPE="ja_JP.UTF-8"
      LC_NUMERIC="ja_JP.UTF-8"
      LC_TIME="ja_JP.UTF-8"
      LC_COLLATE=C.UTF-8
      LC_MONETARY="ja_JP.UTF-8"
      LC_MESSAGES=C.UTF-8
      LC_PAPER="ja_JP.UTF-8"
      LC_NAME="ja_JP.UTF-8"
      LC_ADDRESS="ja_JP.UTF-8"
      LC_TELEPHONE="ja_JP.UTF-8"
      LC_MEASUREMENT="ja_JP.UTF-8"
      LC_IDENTIFICATION="ja_JP.UTF-8"
      LC_ALL=
  4. Directories:

    1. Home:

      /home/piroro
    2. ${XDG_CONFIG_HOME}:

      Environment variable XDG_CONFIG_HOME is not set.

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

    3. Fcitx5 Settings Directory:

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

  5. Current user:

    The script is run as piroro (1000).

Fcitx State:

  1. executable:

    Found fcitx5 at /usr/bin/fcitx5.

  2. version:

    Fcitx version: 5.0.19

  3. process:

    Found 1 fcitx5 process:

      12500 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.462.

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

    Debug information from dbus:

       Group [wayland:] has 1 InputContext(s)
      IC [809968178fd4465faeb9baa239816466] program: frontend:wayland_v2 cap:52 focus:1
    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:

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:

    Cannot find xim_server on root window.

Qt:

  1. qt4 - ${QT4_IM_MODULE}:

    Environment variable QT_IM_MODULE is set to "fcitx" correctly.

  2. qt5 - ${QT_IM_MODULE}:

    Environment variable QT_IM_MODULE is set to "fcitx" correctly.

  3. Qt IM module files:

    Found fcitx5 im module for qt: /usr/lib/qt/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so. Found unknown fcitx qt module: /usr/lib/qt/plugins/kcms/kcm_fcitx5.so. Found fcitx5 qt5 module: /usr/lib/fcitx5/qt5/libfcitx-quickphrase-editor5.so. Found fcitx5 im module for qt6: /usr/lib/qt6/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so. Cannot find fcitx5 input method module for Qt4.

Gtk:

  1. gtk - ${GTK_IM_MODULE}:

    Environment variable GTK_IM_MODULE is set to "fcitx" correctly.

  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:

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

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

      Found fcitx5 im modules for gtk 3.24.34.

      "/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:

      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.34 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.34

      Found fcitx5 im modules for gtk 3.24.34.

      "/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 4:

      Cannot find immodules cache for gtk 4

      Cannot find fcitx5 im module for gtk 4 in cache.

  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 20 enabled addons:

      Classic User Interface 5.0.19
      Clipboard 5.0.19
      DBus 5.0.19
      DBus Frontend 5.0.19
      Emoji 5.0.19
      Fcitx4 Frontend 5.0.19
      IBus Frontend 5.0.19
      Input method selector 5.0.19
      Keyboard 5.0.19
      KDE Input Method Panel 5.0.19
      Mozc
      Status Notifier 5.0.19
      Notification 5.0.19
      Quick Phrase 5.0.19
      Spell 5.0.19
      Unicode 5.0.19
      Wayland 5.0.19
      Wayland Input method frontend 5.0.19
      XCB 5.0.19
      X Input Method Frontend 5.0.19
    2. Found 0 disabled addons:

  3. Addon Libraries:

    All libraries for all addons are found.

  4. User Interface:

    Found 2 enabled user interface addons:

    Classic User Interface
    KDE Input Method Panel

Input Methods:

  1. /home/piroro/.config/fcitx5/profile:

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

Log:

  1. date:

    2022年 10月 15日 土曜日 03:11:34 JST
  2. /home/piroro/.config/fcitx5/crash.log:

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

Piroro-hs commented 1 year ago

The output of fcitx5 -r --verbose *=5 recorded when I change focus to wezterm and type a, if it helps.

[ 403838.649] wl_display@1.delete_id(20)
[ 403838.690] zwp_input_method_v2@15.activate()
D2022-10-17 21:27:08.022522 waylandimserverv2.cpp:127] ACTIVATE
[ 403838.768] zwp_input_method_v2@15.surrounding_text("", 0, 0)
[ 403838.793] zwp_input_method_v2@15.text_change_cause(0)
D2022-10-17 21:27:08.022616 waylandimserverv2.cpp:197] TEXTCHANGECAUSE:00
[ 403838.845] zwp_input_method_v2@15.content_type(0, 0)
D2022-10-17 21:27:08.022668 waylandimserverv2.cpp:193] contentTypeCallback:00
[ 403838.899] zwp_input_method_v2@15.done()
D2022-10-17 21:27:08.022722 waylandimserverv2.cpp:135] DONE
[ 403838.963]  -> zwp_input_method_v2@15.grab_keyboard(new id zwp_input_method_keyboard_grab_v2@20)
D2022-10-17 21:27:08.022811 instance.cpp:2146] Instance::activateInputMethod
D2022-10-17 21:27:08.022852 instance.cpp:2151] Activate: [Last]: [Activating]:mozc
[ 403839.718]  -> zwp_input_method_v2@15.commit(25)
[ 403839.799]  -> wl_display@1.sync(new id wl_callback@21)
[ 403841.566] wl_display@1.delete_id(21)
[ 403841.578] wl_callback@21.done(6132)
[ 403842.524] zwp_input_method_v2@15.surrounding_text("", 0, 0)
[ 403842.541] zwp_input_method_v2@15.text_change_cause(0)
D2022-10-17 21:27:08.026369 waylandimserverv2.cpp:197] TEXTCHANGECAUSE:00x56533b18da90
[ 403842.611] zwp_input_method_v2@15.content_type(0, 0)
D2022-10-17 21:27:08.026430 waylandimserverv2.cpp:193] contentTypeCallback:00
[ 403842.650] zwp_input_method_v2@15.done()
D2022-10-17 21:27:08.026469 waylandimserverv2.cpp:135] DONE
[ 403974.119]  -> wl_compositor@16.create_surface(new id wl_surface@21)
[ 403974.162]  -> zwp_input_method_v2@15.get_input_popup_surface(new id zwp_input_popup_surface_v2@19, wl_surface@21)
D2022-10-17 21:27:08.157989 waylandshmwindow.cpp:61] Buffer state: 0x56533b19d6a0 0
[ 403974.432]  -> wl_surface@21.frame(new id wl_callback@6)
[ 403974.450]  -> wl_surface@21.attach(wl_buffer@13, 0, 0)
[ 403974.460]  -> wl_surface@21.set_buffer_scale(1)
[ 403974.468]  -> wl_surface@21.damage(0, 0, 98, 34)
[ 403974.475]  -> wl_surface@21.commit()
[ 403975.211] wl_buffer@13.release()
[ 405223.785]  -> wl_surface@21.attach(nil, 0, 0)
[ 405223.797]  -> wl_surface@21.commit()
[ 405223.800]  -> zwp_input_popup_surface_v2@19.destroy()
[ 405223.803]  -> wl_surface@21.destroy()
[ 407506.306] wl_display@1.delete_id(19)
[ 407506.340] wl_display@1.delete_id(6)
[ 407506.347] wl_display@1.delete_id(21)
[ 407506.353] zwp_input_method_v2@15.surrounding_text("", 0, 0)
[ 407506.372] zwp_input_method_v2@15.text_change_cause(0)
D2022-10-17 21:27:11.690198 waylandimserverv2.cpp:197] TEXTCHANGECAUSE:00x56533b18da90
[ 407506.453] zwp_input_method_v2@15.content_type(0, 0)
D2022-10-17 21:27:11.690273 waylandimserverv2.cpp:193] contentTypeCallback:00
[ 407506.497] zwp_input_method_v2@15.done()
D2022-10-17 21:27:11.690322 waylandimserverv2.cpp:135] DONE
wengxt commented 1 year ago

does wayfire support zwp_input_method_keyboard_grab_v2 correectly? From what I saw, there's no key event reaches fcitx.

Only support text-input-v3 doesn't do anything useful for input method.

See: https://github.com/WayfireWM/wayfire/issues/1160

Piroro-hs commented 1 year ago

I see. Thanks!