Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes some characters bypass fcitx5 #419

Closed
wanghuibin0 opened this issue Dec 25, 2021 · 3 comments
Closed

Sometimes some characters bypass fcitx5 #419

wanghuibin0 opened this issue Dec 25, 2021 · 3 comments

Comments

@wanghuibin0
Copy link

wanghuibin0 commented Dec 25, 2021

Describe the bug
I am using fcitx5 to input Chinese in emacs.

When I input Chinese, I expect that fcitx5 captures all characters that I type and converts them into Chinese characters.
But sometimes one or more English characters bypass fcitx5 and go to the screen directly.

For example, I want to input "文件". So I enable fcitx5 and type "wenjian".
Sometimes, only "wejian" is captured by fcitx5, the missing "n" goes directly into the application such as emacs.

Such a problem does not occur every time. But it occurs unpredictably, which is quite annoying.

To Reproduce
Steps to reproduce the behavior:

  1. Open emacs app
  2. enable fcitx5
  3. Try to type whatever you like

Expected behavior
The typed characters are all captured by fcitx5.

Desktop (please complete the following information):

  • Desktop: archlinux+i3wm
  • Display server type: X11
  • The output of fcitx5-diagnose if possible.
    The output of "fcitx5-diagnose" is:
# System Info:
1.  `uname -a`:

        Linux arch 5.15.11-arch2-1 #1 SMP PREEMPT Wed, 22 Dec 2021 09:23:54 +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.  Bash Version:

        BASH_VERSION='5.1.12(1)-release'

# Environment:
1.  DISPLAY:

        DISPLAY=':0'


        WAYLAND_DISPLAY=''

2.  Keyboard Layout:

    1.  `setxkbmap`:

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

            C
            en_US.utf8
            POSIX
            zh_CN.utf8

    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/wanghb

    2.  `${XDG_CONFIG_HOME}`:

        Environment variable `XDG_CONFIG_HOME` is not set.

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

    3.  Fcitx5 Settings Directory:

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

5.  Current user:

    The script is run as wanghb (1000).

# Fcitx State:
1.  executable:

    Found fcitx5 at `/usr/bin/fcitx5`.

2.  version:

    Fcitx version: `5.0.11`

3.  process:

    Found 1 fcitx5 process:

           1088 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.4`.

    PID of DBus name `org.fcitx.Fcitx5` owner is `1088`.

    Debug information from dbus:

           Group [x11::0] has 11 InputContext(s)
          IC [7df6d04e1da9428284a30aeebc35ac7e] program:ulauncher frontend:dbus cap:6000000052 focus:0
          IC [9de7b6169cad4e1aa511f7bdbfdf6cc8] program:emacs-27.2 frontend:xim cap:4000000000 focus:0
          IC [d49dc3d6f74240ee928a148e022a2526] program:zotero frontend:dbus cap:6000000012 focus:0
          IC [f0cf7debd01c47a2a5c7365712e7358b] program:zotero frontend:dbus cap:6000000012 focus:0
          IC [9d12875779014e31805305a4c75c9bb8] program:zotero frontend:dbus cap:6000000012 focus:0
          IC [0e4aadf23dce437bab7e383b73f8b0d7] program:xfce4-terminal frontend:dbus cap:6000000012 focus:1
          IC [8231dd02adf24704a7a3fe8acf84183d] program:goldendict frontend:dbus cap:6000800072 focus:0
          IC [8c49ec53c24443ecbd3da39bfcc62c24] program:google-chrome frontend:dbus cap:6000000012 focus:0
          IC [a472bd4d661347e8980e9f89e78d591c] program:zotero frontend:dbus cap:6000000012 focus:0
          IC [bb92a6de096d403e9c8d844a9b44782d] program:zotero frontend:dbus cap:6000000012 focus:0
          IC [b1a8eb2ad4df4295a25f4fdcb59e24e0] program:Nutstore frontend:dbus cap:6000000012 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:
## 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.

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:

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

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

        Found fcitx5 im modules for gtk `3.24.31`.

            "/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.31` 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.31

        Found fcitx5 im modules for gtk `3.24.31`.

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

            Simplified and Traditional Chinese Translation 5.0.9
            Classic User Inteface 5.0.11
            Clipboard 5.0.11
            Cloud Pinyin 5.0.9
            DBus 5.0.11
            DBus Frontend 5.0.11
            Emoji 5.0.11
            Fcitx4 Frontend 5.0.11
            Full width character 5.0.9
            IBus Frontend 5.0.11
            Input method selector 5.0.11
            Keyboard 5.0.11
            KDE Input Method Panel 5.0.11
            Status Notifier 5.0.11
            Notification 5.0.11
            Pinyin 5.0.9
            Extra Pinyin functionality 5.0.9
            Punctuation 5.0.9
            Quick Phrase 5.0.11
            Spell 5.0.11
            Table 5.0.9
            Unicode 5.0.11
            Wayland 5.0.11
            Wayland Input method frontend 5.0.11
            XCB 5.0.11
            X Input Method Frontend 5.0.11

    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 Inteface
        KDE Input Method Panel

## Input Methods:
1.  `/home/wanghb/.config/fcitx5/profile`:

        [Groups/0]
        # Group Name
        Name=Default
        # Layout
        Default Layout=us
        # Default Input Method
        DefaultIM=pinyin

        [Groups/0/Items/0]
        # Name
        Name=keyboard-us
        # Layout
        Layout=

        [Groups/0/Items/1]
        # Name
        Name=pinyin
        # Layout
        Layout=

        [GroupOrder]
        0=Default

# Log:
1.  `date`:

        Sat Dec 25 11:28:30 PM CST 2021

2.  `/home/wanghb/.config/fcitx5/crash.log`:

    `/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.**

Additional context
Add any other context about the problem here.

@wengxt
Copy link
Member

wengxt commented Dec 29, 2021

I only know sometimes this happens on xim + chromium. but with that being said, the issue is not on the fcitx side but on the emacs side. I don't know if you have anything special on the emacs that triggers this because I don't know other people report the same problem.

To help workaround your issue, actually I suggest to switch to emacs's pgtk branch. I heard that it's recently merged into emacs mainstream. It makes emacs use gtk for rendering and input method, which essentially use the gtk im module for input method.

Since you're using arch, try this AUR package: https://aur.archlinux.org/packages/emacs-pgtk-native-comp-git/ . Let me know if you have the same problem with pgtk enabled emacs.

@wengxt wengxt closed this as completed Dec 29, 2021
@wanghuibin0
Copy link
Author

OK, I'll try emacs-pgtk.
Thanks for your help!

@wanghuibin0
Copy link
Author

Very glad that emacs-pgtk works well.
Thank you again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants