NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.37k stars 13.59k forks source link

fcitx5: missing candidate preview popup in non-posix shells #337249

Open zimward opened 2 weeks ago

zimward commented 2 weeks ago

Describe the bug

Fcitx5 stopped showing the candidate preview popup on sway (it was working on nixos-23.11) .

Steps To Reproduce

Steps to reproduce the behavior:

  1. build the test vm nixos-rebuild build-vm --flake "github:zimward/fcitx5-repro#repro"
  2. start fcitx5
  3. enable mozc input
  4. start typing in any application

Expected behavior

A popup with all candidate characters and phrases should be displayed.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Notify maintainers

@poscat0x04

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.10.5-zen1, NixOS, 24.11 (Vicuna), 24.11.20240818.8a33541`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.5`
 - nixpkgs: `/nix/store/d9gbq853jvbccrz5g3y0irbwgc57w137-source`

Add a :+1: reaction to issues you find important.

eclairevoyant commented 2 weeks ago

Can't repro, sounds like incorrect config. Use fcitx5-diagnose maybe and see what's up. Also please specify what app you tried it in, if it's running in native wayland or not, etc.

zimward commented 2 weeks ago
fcitx5-diagnose output ``` # System Info: 1. `uname -a`: Linux kalman 6.10.5-zen1 #1-NixOS ZEN SMP PREEMPT_DYNAMIC Tue Jan 1 00:00:00 UTC 1980 x86_64 GNU/Linux 2. `lsb_release`: `lsb_release` not found. 3. `/etc/lsb-release`: DISTRIB_CODENAME=vicuna DISTRIB_DESCRIPTION="NixOS 24.11 (Vicuna)" DISTRIB_ID=nixos DISTRIB_RELEASE="24.11" LSB_VERSION="24.11 (Vicuna)" 4. `/etc/os-release`: ANSI_COLOR="1;34" BUG_REPORT_URL="https://github.com/NixOS/nixpkgs/issues" BUILD_ID="24.11.20240818.8a33541" DOCUMENTATION_URL="https://nixos.org/learn.html" HOME_URL="https://nixos.org/" ID=nixos IMAGE_ID="" IMAGE_VERSION="" LOGO="nix-snowflake" NAME=NixOS PRETTY_NAME="NixOS 24.11 (Vicuna)" SUPPORT_URL="https://nixos.org/community.html" VERSION="24.11 (Vicuna)" VERSION_CODENAME=vicuna VERSION_ID="24.11" 5. Desktop Environment: Cannot determine desktop environment. 6. XDG SESSION TYPE: XDG_SESSION_TYPE='wayland' 7. Bash Version: BASH_VERSION='5.2.32(1)-release' # Environment: 1. DISPLAY: DISPLAY=':0' WAYLAND_DISPLAY='wayland-1' 2. Keyboard Layout: 1. `setxkbmap`: `setxkbmap` not found. 2. `xprop`: `xprop` not found. 3. Locale: 1. All locales: C C.utf8 de_DE.utf8 en_US.utf8 POSIX 2. Current locale: LANG=de_DE.UTF-8 LC_CTYPE="de_DE.UTF-8" LC_NUMERIC="de_DE.UTF-8" LC_TIME="de_DE.UTF-8" LC_COLLATE="de_DE.UTF-8" LC_MONETARY="de_DE.UTF-8" LC_MESSAGES="de_DE.UTF-8" LC_PAPER="de_DE.UTF-8" LC_NAME="de_DE.UTF-8" LC_ADDRESS="de_DE.UTF-8" LC_TELEPHONE="de_DE.UTF-8" LC_MEASUREMENT="de_DE.UTF-8" LC_IDENTIFICATION="de_DE.UTF-8" LC_ALL= 4. Directories: 1. Home: /home/zimward 2. `${XDG_CONFIG_HOME}`: Environment variable `XDG_CONFIG_HOME` is not set. Current value of `XDG_CONFIG_HOME` is `~/.config` (`/home/zimward/.config`). 3. Fcitx5 Settings Directory: Current fcitx5 settings directory is `~/.config/fcitx5` (`/home/zimward/.config/fcitx5`). 5. Current user: The script is run as zimward (1000). # Fcitx State: 1. executable: Found fcitx5 at `/run/current-system/sw/bin/fcitx5`. 2. version: Fcitx version: `5.1.10` 3. process: Found 2 fcitx5 processes: 72523 .fcitx5-wrapped 134117 fcitx5-diagnose 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.150`. PID of DBus name `org.fcitx.Fcitx5` owner is `72523`. Debug information from dbus: Group [wayland:] has 7 InputContext(s) IC [77c5e93bb98543e2b3f72fe479733910] program:Alacritty frontend:wayland_v2 cap:100000072 focus:1 IC [623ed1177a7442529d812d6255c7a4de] program:steam frontend:wayland_v2 cap:72 focus:0 IC [0cd13995aa4b4f02b9970e93147a61fc] program:info.mumble.Mumble frontend:wayland_v2 cap:72 focus:0 IC [4683d50c8c6f4765b6877280ea1ad3b4] program:FreeTube frontend:wayland_v2 cap:72 focus:0 IC [a3a0935439854e6691c61d7a46edcdf7] program:librewolf frontend:wayland_v2 cap:72 focus:0 IC [cfb6a42195c8488eb101363368acca75] program:thunderbird frontend:wayland_v2 cap:100000072 focus:0 IC [5f94f321ba734f55809146aeb01ebaa0] program: frontend:wayland_v2 cap:100000072 focus:0 Group [x11::0] has 0 InputContext(s) Input Context without group # Fcitx Configure UI: 1. Config Tool Wrapper: Found fcitx5-configtool at `/run/current-system/sw/bin/fcitx5-configtool`. 2. Config GUI for qt: Found `fcitx5-config-qt` at `/run/current-system/sw/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: **`xprop` not found.** ## 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=wayland 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=wayland QT_IM_MODULE=fcitx IM_MODULE_CLASSNAME=fcitx::QFcitxPlatformInputContext 4. Qt IM module files: 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.** **Cannot find fcitx5 input method module for Qt5.** **Cannot find fcitx5 input method module for Qt6.** ## Gtk: 1. gtk - `${GTK_IM_MODULE}`: Environment variable GTK_IM_MODULE is set to "fcitx" correctly. **`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=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: **Cannot find `gtk-query-immodules` for gtk 3** **Cannot find fcitx5 im module for gtk 3.** 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: **Cannot find immodules cache for gtk 3** **Cannot find fcitx5 im module for gtk 3 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: `/nix/store/dg33iq5plc8id84qhkwhssdg133m7jdm-fcitx5-5.1.10/share/fcitx5/addon`. 2. Addon List: 1. Found 20 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 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/zimward/.config/fcitx5/profile`: [Groups/0] # Group Name Name="Gruppe 2" # Layout Default Layout=de # Default Input Method DefaultIM=keyboard-de [Groups/0/Items/0] # Name Name=keyboard-de # Layout Layout= [Groups/1] # Group Name Name="Gruppe 1" # Layout Default Layout=de # Default Input Method DefaultIM=mozc [Groups/1/Items/0] # Name Name=keyboard-de # Layout Layout= [Groups/1/Items/1] # Name Name=mozc # Layout Layout= [GroupOrder] 0="Gruppe 1" 1="Gruppe 2" # Log: 1. `date`: So 25. Aug 17:52:56 CEST 2024 2. `/home/zimward/.config/fcitx5/crash.log`: `/home/zimward/.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.** ```

I have been trying it in Librewolf, Thunderbird and alacritty all on native wayland.

eclairevoyant commented 2 weeks ago

I don't see anything obviously concerning in the output there, basically the same as my results, and mozc does work in librewolf for me :thinking:

zimward commented 1 week ago

After some testing it seems to be related to using a non-posix compliant login shell (like nushell or ion). I have setup a flake to reproduce this. nixos-rebuild build-vm --flake "github:zimward/fcitx5-repro#repro" One thing i already spotted is that fcitx5 sets the QT_PLUGIN_PATH environment variable on posix shells but not in non-posix shells. It is therefore probably not related to sway in particular.

eclairevoyant commented 1 week ago

fcitx5 module sets it here:

https://github.com/NixOS/nixpkgs/blob/8863a9ab2ac6870d569af0cd0be72767ed940ff7/nixos/modules/i18n/input-method/fcitx5.nix#L139

So if your shell doesn't recognise environment.variables that sounds like you'd need to look there. Though I'd say nushell is pretty inappropriate for a login shell IMO, especially in light of https://github.com/nushell/nushell/issues/10316, https://github.com/nushell/nushell/issues/7941, etc

eclairevoyant commented 1 week ago

Anyway wrt nushell this is basically a duplicate of #193880 ion would need its own module as well, etc.