NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.7k stars 13.15k forks source link

IBus module should not set `GTK_IM_MODULE = "ibus"` under gnome #300597

Open 500InternalError opened 3 months ago

500InternalError commented 3 months ago

Describe the bug

IBus module sets GTK_IM_MODULE = "ibus", which causes ibus still leave committed texts on screen in certain apps like gnome-console and nautilus under gnome.

This environment variable should not be set under gnome any longer as it seems that gnome now handles it properly, and setting this variable will break it. (According to this and this)

Steps To Reproduce

Steps to reproduce the behavior:

  1. Launch gnome-console with GTK_IM_MODULE=ibus kgx and type some random texts, then press left shift.
  2. Committed texts leave on screen

Expected behavior

Committed texts should not leave on screen

Screenshots

894C94A188C24669A6BC3772FDAB7AEE

Additional context

Add any other context about the problem here.

Notify maintainers

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.9.0-rc1, NixOS, 24.05 (Uakari), 24.05.20240329.d8fe5e6`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - channels(root): `"nixos"`
 - nixpkgs: `/nix/store/cb1gs888vfqxawvc65q1dk6jzbayh3wz-source`

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

500InternalError commented 3 months ago

Or maybe we can add an option to let user choose whether to set this environment variable or not

500InternalError commented 3 months ago

According to this post, it seems that this variable should not be set when you're under wayland, not just gnome.

mikunimaru commented 3 months ago

Temporary workaround.

environment.variables.GTK_IM_MODULE = lib.mkForce "";

Perhaps the following patch is needed for ibus as well. Unfortunately I do not have time to work on it. https://github.com/NixOS/nixpkgs/pull/278765/files

500InternalError commented 3 months ago

Temporary workaround.

environment.variables.GTK_IM_MODULE = lib.mkForce "";

Perhaps the following patch is needed for ibus as well. Unfortunately I do not have time to work on it. https://github.com/NixOS/nixpkgs/pull/278765/files

It's not a very clean workaround, since it leaves error in log(not important though). For a cleaner workaround, you can fetch the ibus.nix and remove those variables, then disable the original module and import the modified one.