Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I used Gnome for a long time, but preferred vanilla X input method (xim) over the default GTK behaviour. I just set GTK_IM_MODULE and QT_IM_MODULE enviroment variables to xim, and didn't have any problem with multiple-layout config, Compose key, custom ~/.XCompose and misc:typo typography extensions.

Recent Gnome 3.6 completely screwed keyboard input by shipping a half-baked and buggy ibus and forcing it upon the users. I just couldn't get the keyboard working as well as before (even with ibus disabled), and had to abandon Gnome completely.

Now I use a simple window manager, and configure my keyboard with setxkbmap. While the keyboard works well again, I couldn't get get Compose key working everywhere. Compose works in plain X11 apps (xterm), but it doesn't work in neither GTK2, nor GTK3, nor Qt apps.

I use current Archlinux versions:

xorg-xinput 1.6.0
xorg-server 1.13.1
xf86-input-keyboard 1.6.2
gtk2 2.24.14
gtk3 3.6.4
qt 4.8.4

and enable Compose key like this:

setxkbmap ... -option 'compose:menu'

and export GTK_IM_MODULE, QT_IM_MODULE variables:

xim xim

Compose key is propoperly recognized by X11:

$ xev | grep -A2 --line-buffered '^KeyRelease' | sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p'
135 Multi_key

It works properly in xterm, sequences from my ~/.XCompose included. It doesn't work in neither GTK nor Qt apps. Let say, if I enter Compose ', then apps echo ' immediately, without waiting for the third key in the sequence.

Now I suppose something has changed in either Xorg (because Compose doesn't work in Qt apps either), or in GTK and Qt. *_IM_MODULE variables are not enough now. What else is required to make modern GTK and Qt recognise xim and its Compose sequences?

P.S. There is a similar (and unanswered) question about Compose key not working in GTK. Unlike the asker, I don't have ibus installed.

share|improve this question

3 Answers 3

I had a similar problem in openSUSE. ~/.XCompose would be ignored by GTK+ applications, so my own Compose sequences did not work in Firefox, Gimp, and others.

I found out that gtk-query-immodules-2.0 listed a few input methods, but not xim; so, irrespective of the GTK_IM_MODULE variable, xim was unavailable. Installing the packages gtk2-immodule-xim (and friends) solved the problem.

Maybe this remark proves useful for people suffering from the same curse.

share|improve this answer
up vote 2 down vote accepted

Found a solution which works for GTK apps (but not Qt). One needs to set


to let X11 handle dead keys. Thanks to @PabloSaratxaga for his answer.

share|improve this answer

This is a way of persistent configuration. It is described for example here https://wiki.edubuntu.org/ComposeKey#line-66 . I configured compose keys with ~/.XCompose this way. I have checked this both on ubuntu and debian systems.

share|improve this answer
The problem is that even the one-off method has stopped working. Instructions for persistent change are Debian/Ubuntu specific. –  sastanin Jan 15 '13 at 11:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.