fcitx / fcitx5

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

Stop functioning temporarily when switch the focus to Telegram with Alt-Tab to Telegram #1152

Closed foriequal0 closed 3 days ago

foriequal0 commented 1 week ago

Summary

I'm not sure who's responsible for this bug: Telegram Desktop (Downloaded tar.xz from here https://desktop.telegram.org/), QT, Ubuntu, or fcitx5.

Before Ubuntu 24.10, it did this infrequently. I can reliably reproduce this after I updated to Ubuntu 24.10. Losing focus and getting the focus back to Telegram made fcitx5 stop functioning. Always English is typed although the tray icon shows it is in 'Hangul' mode. (I use fcitx5-hangul). I haven't tried other IMs or other QT apps.

Steps to Reproduce

Any of these make fcitx5-related functions stop working, not just inputting Korean. Sometimes Hangul key is problematic in Linux, so I changed the 'Trigger Input Method' hotkey to other conventional keys such as Ctrl+Space, but it didn't work either. So, I checked other extensions were fine, so I tried to invoke the 'Input method selector' with other shortcuts. It also didn't work.

But it works fine when I switch the focus to Telegram using a mouse click. Also, it starts to work again when I alt-tab and make any change in the UI state (e.g. right-clicking an input box to show the context menu, or showing up and closing the user profile info modal)

Also, it is fine under Gnome Xorg. It happens only with Gnome Wayland, Ubuntu Wayland.

Expected Behavior

Be able to type in Korean, and to use fcitx5 shortcuts.

Output of fcitx5-diagnose command

System Info:

  1. uname -a:

    Linux semicolon 6.11.0-8-generic #8-Ubuntu SMP PREEMPT_DYNAMIC Mon Sep 16 13:41:20 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
  2. lsb_release -a:

    Distributor ID: Ubuntu
    Description:    Ubuntu 24.10
    Release:    24.10
    Codename:   oracular
  3. lsb_release -d:

    Description:    Ubuntu 24.10
  4. /etc/lsb-release:

    DISTRIB_ID=Ubuntu
    DISTRIB_RELEASE=24.10
    DISTRIB_CODENAME=oracular
    DISTRIB_DESCRIPTION="Ubuntu 24.10"
  5. /etc/os-release:

    PRETTY_NAME="Ubuntu 24.10"
    NAME="Ubuntu"
    VERSION_ID="24.10"
    VERSION="24.10 (Oracular Oriole)"
    VERSION_CODENAME=oracular
    ID=ubuntu
    ID_LIKE=debian
    HOME_URL="https://www.ubuntu.com/"
    SUPPORT_URL="https://help.ubuntu.com/"
    BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
    PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
    UBUNTU_CODENAME=oracular
    LOGO=ubuntu-logo
  6. Desktop Environment:

    Desktop environment is gnome3.

  7. XDG SESSION TYPE:

    XDG_SESSION_TYPE='wayland'
  8. Bash Version:

    BASH_VERSION='5.2.32(1)-release'

Environment:

  1. DISPLAY:

    DISPLAY=':0'
    
    WAYLAND_DISPLAY='wayland-0'
  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+kr(kr104)+inet(evdev)"  };
          xkb_geometry  { include "pc(pc105)" };
      };
    2. xprop:

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

    1. All locales:

      C
      C.utf8
      POSIX
      en_AG
      en_AG.utf8
      en_AU.utf8
      en_BW.utf8
      en_CA.utf8
      en_DK.utf8
      en_GB.utf8
      en_HK.utf8
      en_IE.utf8
      en_IL
      en_IL.utf8
      en_IN
      en_IN.utf8
      en_NG
      en_NG.utf8
      en_NZ.utf8
      en_PH.utf8
      en_SG.utf8
      en_US.utf8
      en_ZA.utf8
      en_ZM
      en_ZM.utf8
      en_ZW.utf8
      ko_KR.utf8
    2. Current locale:

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

    1. Home:

      /home/foriequal0
    2. ${XDG_CONFIG_HOME}:

      Environment variable XDG_CONFIG_HOME is not set.

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

    3. Fcitx5 Settings Directory:

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

  5. Current user:

    The script is run as foriequal0 (1000).

Fcitx State:

  1. executable:

    Found fcitx5 at /usr/bin/fcitx5.

  2. version:

    Fcitx version: 5.1.10

  3. process:

    Found 2 fcitx5 processes:

      48312 fcitx5
     149985 fcitx5-config-q
  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.1121.

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

    Debug information from dbus:

       Group [wayland:] has 6 InputContext(s)
      IC [b525c828c92a4f5ead91d9f53173b20d] program: frontend:ibus cap:12 focus:1
      IC [9d398987a1b64ecb8697c37e239d6e75] program: frontend:ibus cap:52 focus:0
      IC [c820a3f860974d52891cf9c5d25e8f30] program: frontend:ibus cap:52 focus:0
      IC [59347be1b2af4dc6a9ff2164e168ac49] program: frontend:ibus cap:52 focus:0
      IC [bc6c001f8b7d4c70bb034de21f019379] program: frontend:ibus cap:52 focus:0
      IC [8129376d35df44fba6ca2c6ab4240e9b] program: frontend:ibus cap:52 focus:0
    Group [x11::0] 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}:

    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:

    Xim server name is the same with that set in the environment variable.

  3. XIM for Emacs:

    Your LC_CTYPE is set to C 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.

  4. XIM encoding:

    Your LC_CTYPE is set to C whose encoding is not UTF-8. You may have trouble committing strings using XIM.

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=wayland
    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=QComposeInputContext
  4. Qt IM module files:

    Found fcitx5 im module for qt5: /lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so. Found fcitx5 qt5 module: /lib/x86_64-linux-gnu/fcitx5/qt5/libfcitx-quickphrase-editor5.so. Found fcitx5 qt6 module: /lib/x86_64-linux-gnu/fcitx5/qt6/libfcitx-quickphrase-editor5.so. Found fcitx5 im module for qt6: /lib/x86_64-linux-gnu/qt6/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.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.

    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=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:

      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:

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

      # Created by /usr/lib/x86_64-linux-gnu/libgtk2.0-0t64/gtk-query-immodules-2.0 from gtk+-2.24.33

      Failed to find fcitx5 in immodule cache at /lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules.cache

      Cannot find fcitx5 im module for gtk 2 in cache.

    2. gtk 3:

      Found immodules cache for gtk 3.24.43 at /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-0t64/gtk-query-immodules-3.0 from gtk+-3.24.43

      Found fcitx5 im modules for gtk 3.24.43.

      "/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.10
      Clipboard 5.1.10
      DBus 5.1.10
      DBus Frontend 5.1.10
      Emoji 5.1.10
      Fcitx4 Frontend 5.1.10
      Hangul 5.1.4
      IBus Frontend 5.1.10
      Input method selector 5.1.10
      Keyboard 5.1.10
      KDE Input Method Panel 5.1.10
      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. /home/foriequal0/.config/fcitx5/profile:

    [Groups/0]
    # Group Name
    Name="Group 1"
    # Layout
    Default Layout=kr-kr104
    # Default Input Method
    DefaultIM=hangul
    
    [Groups/0/Items/0]
    # Name
    Name=keyboard-kr-kr104
    # Layout
    Layout=
    
    [Groups/0/Items/1]
    # Name
    Name=hangul
    # Layout
    Layout=
    
    [GroupOrder]
    0="Group 1"

Log:

  1. date:

    Fri Oct 11 16:51:50 KST 2024
  2. /home/foriequal0/.config/fcitx5/crash.log:

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

foriequal0 commented 1 week ago

Hmm. it isn't reproduced anymore... weird.

wengxt commented 3 days ago

So, it looks like you're using gnome. So you might be using qt's text-input-v3, which is quite buggy afaik.

Fcitx can't really help here. Telegram may have custom optimization on using wayland or not.

DebugInfo shows you might be using ibus im module now, which might solve your issue. I believe using either ibus or fcitx for QT_IM_MODULE would be ok on gnome for now.