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

need help: about fltk-based wayland app #1023

Closed
2moe opened this issue Apr 23, 2024 · 1 comment
Closed

need help: about fltk-based wayland app #1023

2moe opened this issue Apr 23, 2024 · 1 comment

Comments

@2moe
Copy link

2moe commented Apr 23, 2024

Describe the bug

When I use fcitx5 to enter ASCII (Latin alphabet & space) on a fltk based app, repeated characters appear.

e.g., hello world -> helllloooo wwooorlddd

Screencast_20240423_215021.mp4

After exiting fcitx5, this problem does not occur.

Screencast_20240423_231347.mp4

输入中文时,候选框会不断闪烁。

有时候莫名奇妙就会触发。

在调整 GUI 应用的窗口大小时,触发闪烁 bug 的概率更高。
The probability of reproduction is higher when resizing the window of that GUI application.

Screencast_20240423_214546.mp4

Note:没有设置 GTK_IM_MODULE , SDL_IM_MODULE & QT_IM_MODULE environment variables.

These problems only occur in wayland.

FLTK implements support of IM according to what is explained in that web page:
https://dorotac.eu/posts/input_method/

Hopefully the developers of fcitx5 can provide some help.

See also: fltk-rs/fltk-rs#1539

To Reproduce

  1. install plasma & fcitx5-chinese-addons
    [BUG] IME problem under wayland fltk-rs/fltk-rs#1539 (comment)

  2. install deps

apt install -y libxkbcommon-dev libwayland-dev wayland-protocols libpango1.0-dev libdbus-1-dev ninja-build  libx11-dev libxext-dev libxft-dev libxinerama-dev libxcursor-dev libxrender-dev libxfixes-dev libpango1.0-dev libgl1-mesa-dev libglu1-mesa-dev cmake g++
  1. unset env vars
unset SDL_IM_MODULE GTK_IM_MODULE QT_IM_MODULE
  1. build the fltk wayland demo app
    [BUG] IME problem under wayland fltk-rs/fltk-rs#1539 (comment)

Expected behavior

"hello world" -> "hello world", not "heeeello worrrrlld"

"不会乱码" -> "不会乱码", not 不�����

Desktop

  • Desktop: KDE
  • Display server type: Wayland

Additional context

事情是这样子的:
起初我用 rust 写 native GUI 应用,之后我发现 fltk-rs 对于 wayland 的 IME 支持有问题,就反馈 issue 给 fltk-rs。
然后, fltk-rs (rust) 的主要维护者把 fltk (C++) 的维护者引进来了。
接着呢!我跟他讨论 rust, 他跟我谈论 C++
哈哈哈,不是。

fltk 的维护者 ManoloFLTK 应该生活在东欧,平时也用不到中文输入法。

据他所述,gnome wayland + ibus-libpinyin 看起来貌似没问题。(之所以用貌似,是因为他看不懂那些汉字)。

在我的引导下,他第一次使用到了 fcitx5 。

希望 fcitx5 的开发者大佬们能提供一些帮助,或者是一些建议。

The output of fcitx5-diagnose:

System Info:

  1. uname -a:

    Linux localhost.localdomain 6.7.9-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.7.9-2 (2024-03-13) x86_64 GNU/Linux
    
  2. lsb_release -a:

    Distributor ID: Debian
    Description:    Debian GNU/Linux trixie/sid
    Release:        n/a
    Codename:       trixie
    
  3. lsb_release -d:

    Description:    Debian GNU/Linux trixie/sid
    
  4. /etc/lsb-release:

    /etc/lsb-release not found.

  5. /etc/os-release:

    PRETTY_NAME="Debian GNU/Linux trixie/sid"
    NAME="Debian GNU/Linux"
    VERSION_CODENAME=trixie
    ID=debian
    HOME_URL="https://www.debian.org/"
    SUPPORT_URL="https://www.debian.org/support"
    BUG_REPORT_URL="https://bugs.debian.org/"
    
  6. Desktop Environment:

    Desktop environment is kde.

  7. XDG SESSION TYPE:

    XDG_SESSION_TYPE='wayland'
    
  8. Bash Version:

    BASH_VERSION='5.2.21(1)-release'
    

Environment:

  1. DISPLAY:

    DISPLAY=':1'
    
    
    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+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
      POSIX
      
    2. Current locale:

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

    1. Home:

      /home/user
      
    2. ${XDG_CONFIG_HOME}:

      Environment variable XDG_CONFIG_HOME is not set.

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

    3. Fcitx5 Settings Directory:

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

  5. Current user:

    The script is run as user (1000).

Fcitx State:

  1. executable:

    Found fcitx5 at /usr/bin/fcitx5.

  2. version:

    Fcitx version: 5.1.8

  3. process:

    Found 2 fcitx5 processes:

        796 fcitx5
       1819 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.8.

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

    Debug information from dbus:

       Group [wayland:] has 4 InputContext(s)
      IC [e84b945b778c4a09a552e883b487b806] program:org.kde.konsole frontend:wayland cap:72 focus:1
      IC [35a8677a549d41879f8c7638d425340f] program:org.kde.plasmashell frontend:wayland cap:72 focus:0
      IC [0d9c7e3360fd4ed393ac4d64d20d407c] program:editor-demo frontend:wayland cap:72 focus:0
      IC [50a91f603de24ac680ad31ebabadb9c7] program: frontend:wayland cap:72 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:

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.

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

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

      Found fcitx5 im modules for gtk 3.24.41.

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

      Simplified and Traditional Chinese Translation 5.1.4
      Classic User Interface 5.1.8
      Clipboard 5.1.8
      Cloud Pinyin 5.1.4
      DBus 5.1.8
      DBus Frontend 5.1.8
      Emoji 5.1.8
      Fcitx4 Frontend 5.1.8
      Full width character 5.1.4
      IBus Frontend 5.1.8
      Lua IME API 5.0.12
      Input method selector 5.1.8
      Keyboard 5.1.8
      KDE Input Method Panel 5.1.8
      Lua Addon Loader 5.0.12
      Status Notifier 5.1.8
      Notification 5.1.8
      Pinyin 5.1.4
      Extra Pinyin functionality 5.1.4
      Punctuation 5.1.4
      Quick Phrase 5.1.8
      Spell 5.1.8
      Table 5.1.4
      Unicode 5.1.8
      DBus Virtual Keyboard 5.1.8
      Wayland 5.1.8
      Wayland Input method frontend 5.1.8
      XCB 5.1.8
      X Input Method Frontend 5.1.8
      
    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/user/.config/fcitx5/profile:

    [Groups/0]
    # Group Name
    Name="Default # Layout"
    # 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 # Layout"
    

Log:

  1. date:

    Tue Apr 23 13:08:09 UTC 2024
    
  2. /home/user/.config/fcitx5/crash.log:

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

@wengxt
Copy link
Member

wengxt commented Apr 23, 2024

not a bug in fcitx

@wengxt wengxt closed this as completed Apr 23, 2024
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