IBus: No more GTK_IM_MODULE=ibus

Version 0.45-1 of im-config just migrated to groovy-release, and there is one not unsignificant change in substance: We now stop to set the GTK_IM_MODULE environment variable to “ibus” on Ubuntu on Xorg.

The GNOME code launches and configures IBus by default (provided that ibus is installed, which it is in Ubuntu). However, up to now we have let im-config override GNOME in this respect.

Input method related variables in focal:

$ env | grep -E 'XMOD|_IM'
GTK_IM_MODULE=ibus
QT4_IM_MODULE=ibus
XMODIFIERS=@im=ibus
CLUTTER_IM_MODULE=ibus
QT_IM_MODULE=ibus

In groovy, from now on, im-config doesn’t do anything on GNOME desktops (unless the user wants to use a non-IBus IM framework), which results in:

$ env | grep -E 'XMOD|_IM'
XMODIFIERS=@im=ibus
QT_IM_MODULE=ibus

I mention this since there have been several subtle issues in the past where the GTK_IM_MODULE value has proved to play a role. One example is bug #1882415 which can be considered fixed through im-config 0.45-1.

But let’s now be attentive to possible issues caused by the fact that GTK_IM_MODULE is no longer set.

An interesting observation

We have had a problem with frequent subtle IBus crashes lately. But the last week on groovy that problem seems to have been significantly reduced:

https://errors.ubuntu.com/?release=Ubuntu%2020.10&package=ibus&period=week

Compare that with the last month:

https://errors.ubuntu.com/?release=Ubuntu%2020.10&package=ibus&period=month

Or with focal the last week (obviously not a fair comparison, but…):

https://errors.ubuntu.com/?release=Ubuntu%2020.04&package=ibus&period=week

This indicates that not setting GTK_IM_MODULE=ibus prevented quite a few crashes which would have happened otherwise, i.e. that the frequent IBus crashes to a large extent is an im-config bug.

@seb128: Should we backport im-config 0.45-1 to focal as an SRU?

@gunnarhj I don’t understand enough what’s the difference in ibus handling with the environment set or unset to have an opinion on a SRU, we would need to assert the impact and the regression potential. With enough testing it sounds like that should something possible to SRU though

@seb128: GNOME has code for enabling GTK_IM_MODULE internally when needed. That’s probably the reason why they don’t let gnome-session set the GTK_IM_MODULE environment variable explicitly.

The reduction in crashes indicates that setting GTK_IM_MODULE to “ibus” explicitly, which we have done up to now via im-config, does not play well with gnome-settings-daemon.

I would suggest that we wait two more weeks to see if the positive trend in groovy with respect to IBus crashes stands. If it does, I think we should do an im-config SRU - with proper verification, of course.

@seb128: I think the tendency is now clear enough to conclude that SRUing im-config in line with how it’s done in 0.45-1 makes a big difference. Please compare this with this. I have prepared bug #1893551 in the hope that the bug description is sufficient.

Do I have a green light from you to prepare the changes and upload?

1 Like

Short IRC discussion:

https://irclogs.ubuntu.com/2020/09/03/%23ubuntu-desktop.html#t09:26

2 Likes