Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Notifications
Mark all as read
Q&A

Disable transient symbols for compose and dead keys in GTK programs

+2
−0

An article in the GTK blog explains the situation very well, but here is my go at it.

In my keyboard layout, accents are handled as dead keys, so to insert "ë", first I type ¨ and then e. Nothing happens on the screen until the very last step, at which point ë is inserted.

That, however, recently changed in all my GTK3 programs: An underlined meta-character is displayed when a dead key is pressed. E.g., when I type ¨, I see an underlined diaeresis:
Meta-character displayed when pressing ¨

Of course, that transient character goes away once I complete the sequence by pressing e, but I find the new behavior confusing because for years I have been used not to see any character until after the key sequence was complete. Now it just looks like I have fat-fingered — not to mention some misbehavior that may occur in some programs when backspacing.

The same happens when using a compose sequences.

Thus the question: How can I disable transient symbols for compose and dead keys and revert back to the good, old behavior?

Why does this post require moderator attention?
You might want to add some details to your flag.
Why should this post be closed?

0 comment threads

1 answer

+2
−0

This is related to GTK having its own input method, which overrules the native X Window System method and even other third-party methods, such as Ibus and Fcitx.

An user with basic needs (for instance, one who only inputs ASCII) wouldn't notice the differences between them. One such difference is Ctrl+Shift+U allowing for hex Unicode input in GTK. Another is the one mentioned in the question.

Fortunately, you can tell GTK which input method to use with the GTK_IM_MODULE environment variable. The available modules can be listed with

gtk-query-immodules-3.0

One who doesn't do fancy things beyond dead keys or compose, which the native X Input Method supports, can simply choose xim from that list.

To verify if it works, launch the GTK application (here, Firefox) with

GTK_IM_MODULE=xim firefox

Once satisfied with the selected input method, put that variable in a initialization file so that you don't have to type it by hand every time. The right file depends on your system; Since I always start my session at a login shell, I find .profile ideal, but others to consider are .xinitrc and .xsession. Note that .bashrc may not be good enough if you log-in via a display manager and want to keep using launchers to start your programs.

Conclusion

Add this line to ~/.profile and reboot.

export GTK_IM_MODULE=xim

Additional references

Why does this post require moderator attention?
You might want to add some details to your flag.

0 comment threads

Sign up to answer this question »