fcitx/fcitx5

[Fcitx5 wayland] Double space after compose key was used.

Closed this issue · 5 comments

Summary

When I use Ukrainian layout and press the compose key in order to use the special characters I need, fcitx5 forces me to press space 2 times before actual space appears. See the video below.

bug.mp4

And sometimes it even stucks in compose mode, and won't exit it after sometimes.

Steps to Reproduce

  1. Set up fcitx5 on wayland compositor like sway/hyprland.
  2. Set up xkb_options compose:ralt.
  3. Choose the US and Ukrainian layouts as 2 input methods.
  4. Open libreoffice/discord/etc.
  5. Switch to Ukrainian layout.
  6. Press compose key and then dash/plus/s/k key

Expected Behavior

After using special character there should not be any need in second space in order to get "the true space"

Output of fcitx5-diagnose command

System Info:

  1. uname -a:

    Linux ArchLinux 6.6.35-2-lts #1 SMP PREEMPT_DYNAMIC Fri, 21 Jun 2024 21:05:23 +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=''
    
  8. Bash Version:

    BASH_VERSION='5.2.26(1)-release'
    

Environment:

  1. DISPLAY:

    DISPLAY=':0'
    
    
    WAYLAND_DISPLAY=''
    
  2. Keyboard Layout:

    1. setxkbmap:

      Authorization required, but no authorization protocol specified
      
      Cannot open display ":0"
      
    2. xprop:

      Authorization required, but no authorization protocol specified
      
      xprop:  unable to open display ':0'
      
  3. Locale:

    1. All locales:

      C
      C.utf8
      en_GB.utf8
      en_US.utf8
      ja_JP.utf8
      POSIX
      uk_UA.utf8
      
    2. Current locale:

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

    1. Home:

      /root
      
    2. ${XDG_CONFIG_HOME}:

      Environment variable XDG_CONFIG_HOME is not set.

      Current value of XDG_CONFIG_HOME is ~/.config (/root/.config).

    3. Fcitx5 Settings Directory:

      Current fcitx5 settings directory is ~/.config/fcitx5 (/root/.config/fcitx5).

  5. Current user:

    The script is run as root (0).

    1. sudo Environment Variables:

      SUDO_COMMAND is set to /sbin/fcitx5-diagnose.

      SUDO_USER is set to pan_svichka.

      SUDO_UID is set to 1000.

      SUDO_GID is set to 1000.

    2. Running as root:

      You are probably using sudo to run this script. This means the result of this script may not be accurate. See sudo environment variables for more information.

Fcitx State:

  1. executable:

    Found fcitx5 at /sbin/fcitx5.

  2. version:

    Fcitx version: 5.1.10

  3. process:

    Fcitx5 is not running.
    Please check the Configure link of your distribution in Beginner's Guide for how to setup fcitx5 autostart.

Fcitx Configure UI:

  1. Config Tool Wrapper:

    Found fcitx5-configtool at /sbin/fcitx5-configtool.

  2. Config GUI for qt:

    Found fcitx5-config-qt at /sbin/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}:

    XMODIFIERS is not set

    Please set environment variable XMODIFIERS to "@im=fcitx" using the tool your distribution provides or add export XMODIFIERS=@im=fcitx to your ~/.xprofile. See Input Method Related Environment Variables: XMODIFIERS.
    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}:

    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:

  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:

  4. Qt IM module files:

    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 im module for qt: /usr/lib/qt/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.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}:

    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:

    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:

  2. gtk-query-immodules:

    1. gtk 2:

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

      # Created by /sbin/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:*" 
      

      Found gtk-query-immodules for unknown gtk version at /sbin/gtk-query-immodules-2.0-32.

      Failed to find fcitx5 in the output of /sbin/gtk-query-immodules-2.0-32

    2. gtk 3:

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

      # Created by /sbin/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:*" 
      

      Found gtk-query-immodules for unknown gtk version at /sbin/gtk-query-immodules-3.0-32.

      Failed to find fcitx5 in the output of /sbin/gtk-query-immodules-3.0-32

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

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

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

      Failed to find fcitx5 in immodule cache at /usr/lib32/gtk-2.0/2.10.0/immodules.cache

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

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

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

      Failed to find fcitx5 in immodule cache at /usr/lib32/gtk-3.0/3.0.0/immodules.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 21 enabled addons:

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

    /root/.config/fcitx5/profile not found.

Log:

  1. date:

    Thu 27 Jun 21:56:07 EEST 2024
    
  2. /root/.config/fcitx5/crash.log:

    /root/.config/fcitx5/crash.log not found.

wengxt commented

Can you run fcitx5-diagnose again with your own user?

I think the issue is that you're using sway, which input method has no way to know the xkb option being set. So there's a workaround to manually set the xkb layout option in the global config. Can you check "override xkb option" and set the custom xkb option to ralt:compose in the global config?

here the nonroot diagnose from hyprland (because i accidentally broke sway and don't have time to fix it)
nonrootFCITX5.txt

And i have put ralt:compose in fcitx5 custom xkb option after enabling "Override xkb option", but if it all stays the same. Tho if i comment kb_options = compose:ralt line, the issue with double space is gone, but now compositor will just use the ralt as just alt_L

wengxt commented

I'm not sure about what's your expectation, but I believe compose is just work like that.

Compose means you need to press a sequence of key to produce a character.

The default config is located at : /usr/share/X11/locale/en_US.UTF-8/Compose

The default config contains following:

<Multi_key> <space> <space>>>−−−: " ">−−nobreakspace # NO-BREAK SPACE

Which means, RAlt, space, space will produce this "no break space" character (U+00A0). It's not a normal space.

I wonder if you're actually asking for level3 as RAlt option?

wengxt commented

"lv3:ralt_switch" the xkb option name that use Ralt as ISO_Level3_Shift.
"compose:ralt" will make ralt to produce Multi_key

Thank you very much! The issue is gone now! I would never new that this was this option wrong all along!