fcitx/fcitx5

Mozc incorrectly treats right-click combined with certain keys as a dead-key modifier under Wine

Closed this issue · 1 comments

Summary

Repost from google/mozc#999, as it seems more like a Fcitx issue than a Mozc issue at this point.

Under wine, holding right click and pressing certain inputs, it will incorrectly activate a deadkey, seemingly adding punctuation as a deadkey.

The keys I've found this to be an issue with are J and - (On american keyboards, this would be /, next to the right shift button).

This interferes with games especially, as Fcitx will not pass the input onto the game itself, resulting in missed keystrokes.

Extra relevant info from the original bug report:

  • What applications this issue happens on (e.g. Chromium, gedit).
    • Wine Notepad (notepad.exe)
    • Wine Explorer.exe
    • Final Fantasy XIV Online running under Wine
  • What applications this issue does not happen on (e.g. Chromium, gedit).
    • Have not encountered this in Linux native applications (tested under Firefox, Kate, kitty, Lutris (the main app), Steam)

Steps to Reproduce

  1. Open a wine application
  2. Hold right click
  3. Type - or J. Likely easier to test with J internationally

Expected Behavior

Expected behavior

Nothing. The application should simply receive the input as expected

Screenshots demonstrating the behaviour:

image
Screenshot_20240730_023547

Environment

  • OS: Arch Linux
  • IMF: Fcitx
  • Wine - Specifically tested under Wine Notepad and the video game Final Fantasy XIV Online.
  • Native Keymap: Danish

Output of fcitx5-diagnose command

Username is redacted as [user].

[[user]@telogrus ~]$ LC_ALL=C fcitx5-diagnose

System Info:

  1. uname -a:

    Linux telogrus 6.10.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 27 Jul 2024 16:49:55 +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:

    Desktop environment is kde.

  7. XDG SESSION TYPE:

    XDG_SESSION_TYPE='x11'
    
  8. Bash Version:

    BASH_VERSION='5.2.26(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+dk+inet(evdev)+terminate(ctrl_alt_bksp)"	};
      	xkb_geometry  { include "pc(pc104)"	};
      };
      
    2. xprop:

      _XKB_RULES_NAMES(STRING) = "evdev", "pc104", "dk", "", "terminate:ctrl_alt_bksp"
      
  3. Locale:

    1. All locales:

      C
      C.utf8
      POSIX
      en_DK.utf8
      
    2. Current locale:

      LANG=en_DK.UTF-8
      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/[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.10

  3. process:

    Found 1 fcitx5 process:

       1268 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.71.

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

    Debug information from dbus:

       Group [x11::0] has 16 InputContext(s)
      IC [6fc84855b8d0413ab2e77149962fc558] program:kate frontend:dbus cap:6000800072 focus:0
      IC [4b7e38d9f6e24237a127d1f5dfc7d676] program:plasmashell frontend:dbus cap:16000800072 focus:0
      IC [06bef01404b64b75bcb4e6f2b5e83221] program: frontend:ibus cap:12 focus:1
      IC [14fdb5e7b2754ca7872babd1996bbcc8] program:steam frontend:dbus cap:12 focus:0
      IC [ae78f7a7ed184193a21910acff74e6d3] program:steamwebhelper frontend:dbus cap:12 focus:0
      IC [23a4a8adf806457ca531b9c2d865dc86] program:lutris frontend:dbus cap:6000000032 focus:0
      IC [f1039be2b27c44459c149104ceaeea7a] program:plasmashell frontend:dbus cap:16000800072 focus:0
      IC [5f7ec93a51544621b6286e34b3097f9d] program:firefoxdeveloperedition frontend:dbus cap:6000000032 focus:0
      IC [d10cbbc13b5640fe8e44dd6a041d7d6a] program:wine64-preloader frontend:xim cap:4000000000 focus:0
      IC [c0f876303aa2472eab26c8cfe5cb46a4] program:firefoxdeveloperedition frontend:dbus cap:6000000032 focus:0
      IC [91c9838ebed14400a5e3d921b8d749af] program:plasmashell frontend:dbus cap:16000800072 focus:0
      IC [e2367ca0cef04367a891e20f4763b788] program:firefoxdeveloperedition frontend:dbus cap:6000000072 focus:0
      IC [516fb65ee105497b8d146296c12c26ed] program:discord frontend:dbus cap:6000000032 focus:0
      IC [a3531729f42e4083a509631b44b66e80] program:firefoxdeveloperedition frontend:dbus cap:6000000032 focus:0
      IC [5e2d3e4519794b228b88c5b766ef7b3b] program:firefoxdeveloperedition frontend:dbus cap:6000000032 focus:0
      IC [59445652aad5429695a7c642b43da4b3] program:firefoxdeveloperedition frontend:dbus cap:6000000032 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:

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.

  3. 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}:

    Environment variable QT_IM_MODULE is set to "fcitx" correctly.

    fcitx5-qt4-immodule-probing not found.

  2. qt5 - ${QT_IM_MODULE}:

    Environment variable QT_IM_MODULE is set to "fcitx" correctly.

    Using fcitx5-qt5-immodule-probing to check the actual im module to be used under current environment:

    QT_QPA_PLATFORM=xcb
    QT_IM_MODULE=fcitx
    IM_MODULE_CLASSNAME=fcitx::QFcitxPlatformInputContext
    
  3. qt6 - ${QT_IM_MODULE}:

    Environment variable QT_IM_MODULE is set to "fcitx" correctly.

    Using fcitx5-qt6-immodule-probing to check the actual im module to be used under current environment:

    QT_QPA_PLATFORM=xcb
    QT_IM_MODULE=fcitx
    IM_MODULE_CLASSNAME=fcitx::QFcitxPlatformInputContext
    
  4. Qt IM module files:

    Found unknown fcitx qt module: /usr/lib/qt6/plugins/plasma/kcms/systemsettings/kcm_fcitx5.so.
    Found fcitx5 im module for qt6: /usr/lib/qt6/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so.
    Found fcitx5 qt6 module: /usr/lib/fcitx5/qt6/libfcitx-quickphrase-editor5.so.
    Found fcitx5 qt5 module: /usr/lib/fcitx5/qt5/libfcitx-quickphrase-editor5.so.
    Found fcitx5 im module for qt: /usr/lib/qt/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}:

    Environment variable GTK_IM_MODULE is set to "fcitx" correctly.

    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:

    GTK_IM_MODULE=fcitx
    

    Using fcitx5-gtk4-immodule-probing to check the actual im module to be used under current environment:

    GTK_IM_MODULE=fcitx
    
  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.43 at /usr/bin/gtk-query-immodules-3.0.
      Version Line:

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

      Found fcitx5 im modules for gtk 3.24.43.

      "/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.43 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.43
      

      Found fcitx5 im modules for gtk 3.24.43.

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

      Anthy 5.1.4
      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
      Lua IME API 5.0.13
      Input method selector 5.1.10
      Keyboard 5.1.10
      KDE Input Method Panel 5.1.10
      Lua Addon Loader 5.0.13
      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. /home/[user]/.config/fcitx5/profile:

    [Groups/0]
    # Group Name
    Name=Default
    # Layout
    Default Layout=dk
    # Default Input Method
    DefaultIM=anthy
    
    [Groups/0/Items/0]
    # Name
    Name=keyboard-dk
    # Layout
    Layout=
    
    [Groups/0/Items/1]
    # Name
    Name=mozc
    # Layout
    Layout=
    
    [Groups/0/Items/2]
    # Name
    Name=keyboard-us
    # Layout
    Layout=
    
    [Groups/0/Items/3]
    # Name
    Name=anthy
    # Layout
    Layout=
    
    [GroupOrder]
    0=Default
    

Log:

  1. date:

    Wed Jul 31 19:51:01 CEST 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.

Though such information can be helpful to developers for diagnostic purpose, please double check and remove as necessary before posting it online publicly.

This is actually very interesting...

The key state contains the (1<<10) bit, which is Button3Mask (Right key is "button 3"). I send that bit to xkb common, and xkb common gives me the dead key.

But it seems to be wrong as xkb map may use some of this state bit internally. XKB_STATE_NOTIFY_EVENT also not contain the button mask, so I guess that would be the expected behavior when using xkb.

For now, as a workaround before the fix is contained in the next release, I think you can do:

  1. create a new group, and set the system default layout of that group to Danish (No dead key), if you still want Danish (or whatever you think that's good for the game playing).
  2. switch to that group with super+space (default key) when you playing the game. (Hopefully you don't care about input method while playing the wine'd game :) ).