Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1054622: im-config: can set GTK_IM_MODULE to xim, which causes GTK 4 to complain

398 views
Skip to first unread message

brian m. carlson

unread,
Oct 26, 2023, 6:10:05 PM10/26/23
to
Package: im-config
Version: 0.57-2
Severity: normal

I have a system with Zoom installed, which necessitates installing ibus,
which I don't want to use (because it overrides my shortcut keys without
consent). Thus, the advice I've received is to install im-config and
use to set the module to "xim". I don't care very much what input
method is used, but it must not touch any shortcut keys and it must
support the Compose key correctly so I can type Spanish, French, and
various punctuation signs (e.g., ellipsis, section, and various dashes).

Now, with that context, I have an editor that uses GTK+ 4 (Neovim-GTK),
which I frequently invoke from the command line. GTK+ 4 does not
support xim, and thus it screams to the terminal like so:

(NeovimGtk:2644084): Gtk-WARNING **: 21:29:13.213: No IM module matching GTK_IM_MODULE=xim found

Since this is an editor I invoke from the command line, the terminal
noise is unwelcome. I have had to unset the appropriate environment
variable in my terminal in the meantime.

I don't think, given that GTK+ 4 is used for a wide variety of software
in Debian, that it's safe to set GTK_IM_MODULE to "xim" anymore, and
im-config needs to not do that. More generally, im-config needs to not
set global environment variables which cause programs to log loudly to
the terminal, and unfortunately GTK+ programs do exactly that. Because
the GTK+ developers don't see screaming to the terminal as a problem and
won't fix it or provide a way to disable it, the solution has to be in
im-config instead. (Of course, you are welcome to try to convince the
GTK+ developers nonetheless.)

-- Package-specific info:
=== command path ==
im-config is /usr/bin/im-config

=== im-config API -l: available IM ===
im-config -l => ibus xim

=== im-config API -m: selected IM ===
im-config -m =>
'system' 'user' 'automatic' 'override' 'autobase'
'default' 'custom' 'ibus' '' 'ibus'

=== /etc/default/im-config ==
# Default im-config mode (see im-config(8))

# This im-config helps to start best available input method (IM)

# Always start highest priority IM
IM_CONFIG_DEFAULT_MODE=auto
# Start or not to start IM dynamically under CJKV/desktop environment
#IM_CONFIG_DEFAULT_MODE=cjkv
# Never start IM by im-config (Leave it to desktop system)
#IM_CONFIG_DEFAULT_MODE=none

# cjkv mode behavior:
# case 1:
# * desktop is listed in CJKV_DEFAULT_DESKTOP
# * locale is under so-called CJKV environments
# --> auto mode
# case 2:
# * desktop is listed in CJKV_DEFAULT_DESKTOP
# * locale is *not* under so-called CJKV environments
# --> none mode
# case 3:
# * desktop is *not* listed in CJKV_DEFAULT_DESKTOP
# * locale is under any environments
# --> auto mode
#
CJKV_DEFAULT_DESKTOP="*"
#CJKV_DEFAULT_DESKTOP="KDE:LXQt:XFCE"

# List of locales for so-called CJKV environments
CJKV_LOCALES="zh_TW:zh_HK:zh_SG:zh_CN:ja_JP:ko_KR:vi_VN"

# Set locale dependent preferred IM over standard auto mode if not GNOME
IM_CONFIG_PREFERRED_RULE="zh_CN,fcitx5:zh_TW,fcitx5:zh_HK,fcitx5:zh_SG,fcitx5"

# User and system wide configuration is normally done via im-config program.
# The above IM_CONFIG_PREFERRED_RULE sets locale dependent preferred IM
# override rule. If you wish to use uim over ibus just for ja_JP,
# add :ja_JP,uim at the end of the above list. (Marked by "!" in GUI)

# List of desktop systems which starts ibus if available
# Applicable desktops are excluded for applying IM_CONFIG_PREFERRED_RULE
DESKTOP_SETUP_IBUS="GNOME"

# Trace commands for debug
# (This may cause problem configuration file generated under console mode)
#IM_CONFIG_SETMODE="-x"

# Verbose output for debug (uncomment following)
#IM_CONFIG_VERBOSE="true"


=== localectl status ===
System Locale: LANG=en_CA.UTF-8
LANGUAGE=en_CA:en
VC Keymap: (unset)
X11 Layout: us
X11 Model: pc105

=== /etc/X11/default-display-manager ===
/usr/sbin/lightdm

=== setxkbmap -print ===
xkb_keymap {
xkb_keycodes { include "evdev+aliases(qwerty)" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols { include "pc+us+inet(evdev)+capslock(escape)+ctrl(swap_rwin_rctl)+compose(lwin)+terminate(ctrl_alt_bksp)" };
xkb_geometry { include "pc(pc102)" };
};

=== ~/.Xmodmap ===
clear control
clear mod4
add control = Control_L
add mod4 = Control_R

=== environment vars ==
DISPLAY=:0
XDG_CURRENT_DESKTOP=MATE
XDG_GREETER_DATA_DIR=/var/lib/lightdm/data/bmc
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_SESSION_CLASS=user
XDG_SESSION_DESKTOP=lightdm-xsession
XDG_SESSION_ID=2
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_SESSION_TYPE=x11
XDG_VTNR=7
CLUTTER_IM_MODULE=xim
QT_IM_MODULE=xim
XMODIFIERS=@im=none


-- System Information:
Debian Release: trixie/sid
APT prefers oldstable-security
APT policy: (500, 'oldstable-security'), (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.5.0-1-amd64 (SMP w/20 CPU threads; PREEMPT)
Kernel taint flags: TAINT_USER, TAINT_WARN
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8), LANGUAGE=en_CA:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages im-config depends on:
ii gettext-base 0.21-13+b1

Versions of packages im-config recommends:
ii whiptail 0.52.23-1+b1
ii x11-common 1:7.7+23
ii zenity 3.44.2-1

im-config suggests no packages.

-- no debconf information

--
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA
signature.asc

Gunnar Hjalmarsson

unread,
Oct 26, 2023, 7:10:06 PM10/26/23
to
On 2023-10-26 23:51, brian m. carlson wrote:
> I have a system with Zoom installed, which necessitates installing
> ibus, which I don't want to use (because it overrides my shortcut
> keys without consent). Thus, the advice I've received is to install
> im-config and use to set the module to "xim".

That's bad advice. Where did you get it?

Don't set it to "xim", set it to "none" instead, which means that
im-config does not touch any environment variables (and does not launch
ibus-daemon).

im-config -n none

> I don't think, given that GTK+ 4 is used for a wide variety of
> software in Debian, that it's safe to set GTK_IM_MODULE to "xim"
> anymore, and im-config needs to not do that.

Your observation is not a sufficient reason to conclude that "xim" is
never useful and should be removed as an option. im-config does not set
that option automatically, but only if the user chooses it explicitly.
In your case due to a bad advice. ;)

So I'm inclined to close this bug as a "wontfix", but await possible
further input on the matter.

--
Cheers,
Gunnar Hjalmarsson

brian m. carlson

unread,
Oct 26, 2023, 8:40:05 PM10/26/23
to
On 2023-10-26 at 22:51:19, Gunnar Hjalmarsson wrote:
> On 2023-10-26 23:51, brian m. carlson wrote:
> > I have a system with Zoom installed, which necessitates installing
> > ibus, which I don't want to use (because it overrides my shortcut
> > keys without consent). Thus, the advice I've received is to install
> > im-config and use to set the module to "xim".
>
> That's bad advice. Where did you get it?
>
> Don't set it to "xim", set it to "none" instead, which means that im-config
> does not touch any environment variables (and does not launch ibus-daemon).

I believe I got it when I filed a bug report on ibus about some bug
where it affected my input in some way. I don't recall, since it's been
some time.

> > I don't think, given that GTK+ 4 is used for a wide variety of
> > software in Debian, that it's safe to set GTK_IM_MODULE to "xim"
> > anymore, and im-config needs to not do that.
>
> Your observation is not a sufficient reason to conclude that "xim" is never
> useful and should be removed as an option. im-config does not set that
> option automatically, but only if the user chooses it explicitly. In your
> case due to a bad advice. ;)
>
> So I'm inclined to close this bug as a "wontfix", but await possible further
> input on the matter.

I'd argue that setting any environment variables that make programs
scream to the terminal is not okay. I'm fine with im-config setting any
value that doesn't do that.
signature.asc

Osamu Aoki

unread,
Oct 27, 2023, 8:30:06 AM10/27/23
to
Hi,

Let's not repeat our discussion on im-config by discussing how ZOOM (external to
Debian with poor record to provide proper dependencies in its deb package
despite our advise to correct it) interacts with Debian default settings.

Having said it, I still think it is worth discussing how im-config should set
environment variables in near future especially with how wayland is getting its
popularity.

Please read notable links on this topics first:

* Input Method Hub --
- https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/39
* Wayland and input methods -- wayland-protocol description
- https://dorotac.eu/posts/input_method/
* Using Fcitx 5 on Wayland -- view by fcitx community
- https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland
* about Input Method wayland protocols #2331 -- view by ibus maintainer
- https://github.com/ibus/ibus/issues/2331
* New ideas using Wayland Input Methods -- view by QT people? August 3, 2023
-
https://blog.davidedmundson.co.uk/blog/new-ideas-using-wayland-input-methods/

I don't understand all the details but this topic for input method in wayland
seems to be very much in development phase as of October/2023. I think it is
worth tracking this technical development.

Most interesting part was: "Do we still need XMODIFIERS, GTK_IM_MODULE and
QT_IM_MODULE?" --> For XMODIFIERS, yes, we do. X11 application running under X11
and XWayland has nearly no difference.

Let me comment on this bug report.

On Fri, 2023-10-27 at 00:17 +0000, brian m. carlson wrote:
> On 2023-10-26 at 22:51:19, Gunnar Hjalmarsson wrote:
> > On 2023-10-26 23:51, brian m. carlson wrote:
> > > I have a system with Zoom installed, which necessitates installing
> > > ibus, which I don't want to use (because it overrides my shortcut
> > > keys without consent).  Thus, the advice I've received is to install
> > > im-config and use to set the module to "xim".

Have you read the previous bug report thoroughly before posting this.
Specifically:
* https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=988540

> > That's bad advice. Where did you get it?

Setting to "xim" was only mentioned by the bug reporter and we corrected it as
bad idea and promoted to use "none".

> > Don't set it to "xim", set it to "none" instead, which means that im-config
> > does not touch any environment variables (and does not launch ibus-daemon).
>
> I believe I got it when I filed a bug report on ibus about some bug
> where it affected my input in some way.  I don't recall, since it's been
> some time.
> > > I don't think, given that GTK+ 4 is used for a wide variety of
> > > software in Debian, that it's safe to set GTK_IM_MODULE to "xim"
> > > anymore, and im-config needs to not do that.

Please present links to support your technical references.

By the way, the GTK+ was used for only up to version 3. I think its name is now
GTK4 library.

> > Your observation is not a sufficient reason to conclude that "xim" is never
> > useful and should be removed as an option. im-config does not set that
> > option automatically, but only if the user chooses it explicitly. In your
> > case due to a bad advice. ;)
> >
> > So I'm inclined to close this bug as a "wontfix", but await possible further
> > input on the matter.

I agree.


> I'd argue that setting any environment variables that make programs
> scream to the terminal is not okay.  I'm fine with im-config setting any
> value that doesn't do that.

Since wiki page https://wiki.debian.org/Keyboard is referenced in README.Debian
of im-config, I updated this wiki page to make it easier to find this proper
work around.

https://wiki.debian.org/Keyboard#IM_framework_disabled_case_.28XKB.29

Regards,

Osamu

Osamu Aoki

unread,
Oct 27, 2023, 9:00:06 AM10/27/23
to
Control: tags -1 wontfix
thanks

Since setting to im-config "xim" was user action, its consequences are none of
our business. Gunnar, I will set this as wontfix.

Brian, zoom is non-free external program. Neovim-GTK seems to be your locally
compiled package, they are not good examples of issues to be fixed.

I do understand new GTK4 may complain as warning if you set GTK_IMMODULE to xim.
So please just don't do it.
0 new messages