Comments on Disable transient symbols for compose and dead keys in GTK programs
Parent
Disable transient symbols for compose and dead keys in GTK programs
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:
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?
Post
The following users marked this post as Outdated:
User | Comment | Date |
---|---|---|
Quasímodo |
Thread: Outdated This answer might be outdated or incomplete. I cannot reproduce the fix for some programs in Ubuntu. |
Jun 21, 2023 at 16:58 |
This is originally Ibus' (an input method) behavior. It provides some facilities to extend the basic "input by typing". Examples:
Now, to complicate matters, GTK has its own input method too, which is inspired in Ibus, and overrules the native X Window System method and perhaps (it's not clear to me) even other third-party input methods.
An user with basic needs, who doesn't do much beyond dead keys or compose, which the native X Input Method supports, can do away with all that extra functionality.
So first uninstall Ibus, or, if unsure, just kill it:
pkill ibus
Then, use GTK_IM_MODULE=xim
environment variable to tell GTK you don't want its input method, but X's.
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
-
Uninstall Ibus.
-
Add this line to
~/.profile
and reboot.export GTK_IM_MODULE=xim
It might be that only one of those is needed depending on your set up.
Additional references
- Fcitx: Input method related environment variables.
- Unix & Linux: Dead (compose) keys not working in GTK apps since upgrade.
- Unix & Linux: Understanding and setting up different input methods.
- Wikipedia: List of input methods for Unix platforms.
0 comment threads