GNOME Bugzilla – Bug 155010
Configurable compose tables for gtkimcontextsimple.c (patch)
Last modified: 2015-08-05 22:17:03 UTC
I have a patch that will allow users to use customized compose tables with gtkimcontextsimple.c. It affects the files gtkrc.c, gtkrc.h, gtkimconstextsimple.c, gtksettings.c, and gdk/x11/gdkevents-x11.c and introduces gtkcompose.h and gtkcompose.c. Further, I have a small patch for the gnome-settings-daemon, to allow a change of the compose-theme at runtime. Rationale: Why customize the compose table? Although the hardcoded default compose table in gtkimcontextsimple.c is quite good, it can never satisfy all users' needs. For example, I often input ō (o with a macron), which has beed droped in favor of õ (o with tilde). I assume that there is good reason, why the hardcoded table has a different compose rule, therefore I need customization. Now I use a small customized table with overrides the sequence "Multi_key" "o" "-" to ō. Why not use an IM-module? While IM-modules can use GtkIMContextSimple with custom compose tables, immodules cannot modify the default table. However, this will be desirable if you already use another IM-module (e.g. uim-anthy) that uses GtkIMContextSimple as a slave context. Therefore I prefere to configure the fallback tables used by GtkIMContextSimple directly, instead of patching each IM-module. Implementation: Compose tables can be put in general gtkrc-files (e.g. ~/.gtkrc-2.0) or a compose-theme's gtkrc file (e.g. ~/.themes/MyTheme/gtk-2.0-compose/gtkrc). Syntax: composetable "example" { compose { "Multi_key" "O" "-" } "Ō" compose { "Multi_key" "o" "-" } 0x014C } The name string "example" is optional. If there are two or more tables with the same name, the name with the highest priority will be used and the others will be removed. The priority may be set before the opening brace { of the table. (Of course you can use many tables with different names or no name.) The table in gtkimcontextsimple.c is still in place as a hardcoded table. Tables added by IM-modules still work the same way and will be processed before any other table. Please tell me, what you think about it.
Created attachment 32440 [details] [review] Compose table patch for Gtk+
Created attachment 32441 [details] [review] Compose table patch for gnome-control-center/gnome-settings-daemon This will make the gnome-settings-daemon handle a change of the gtk_compose_theme_name gconf-key. The control-center does not allow to set this value yet. (use gconf-editor or gconftool)
I noticed that this bug-report has finally reached the status "new". I hope that there will be some progress now and I want to add, that I offer to make a smaller patch that only adds customization via .gtkrc-2.0 without compose-table-themes. This means that there wouldn't be a need to touch gtksettings.c, gdk/x11/gdkevents-x11.c, or the gnome-settings-daemon.
There is a related report at bug 321896. The existing entries in gtkimcontextsimple.c come from XFree86 and the Compose file as it was several years ago. However, the "Compose" file has progressed and has expanded to cover more languages (it now includes Ō).
(In reply to comment #4) > There is a related report at bug 321896. > > The existing entries in gtkimcontextsimple.c come from XFree86 and the Compose > file as it was several years ago. However, the "Compose" file has progressed > and has expanded to cover more languages (it now includes Ō). > While the current gtkimcontextsimple.c http://cvs.gnome.org/viewcvs/gtk%2B/gtk/gtkimcontextsimple.c?rev=1.57.2.1&view=markup includes a way to write Ō and ō, that requires a GDK_dead_macron key, and normally keyboards doesn't have such a key. There is still the illogical behaviour that compose + - + a -> ã compose + - + i -> ī compose + - + u -> ū compose + - + e -> ē compose + - + o -> õ compose + _ + a -> ª compose + _ + i -> ī compose + _ + u -> ū compose + _ + e -> ē compose + _ + o -> º
Carl, can you check whether the same issue exists with upstream? (that is, in Xorg) The file is at http://gitweb.freedesktop.org/?p=xorg/lib/libX11.git;a=blob_plain;f=nls/en_US.UTF-8/Compose.pre Whether GDK_dead_macron key is used or not is up to the xkeyboard-config project and the individual keyboard layouts that are placed there. You can contact the maintainer to update the layout files. The xkeyboard-config project is hosted at http://www.freedesktop.org/wiki/Software_2fXKeyboardConfig and to the best of my knowledge it has not been moved to git yet (that is, use CVS).
Using Gnome 2.26.1 on Ubuntu 9.04 (Jaunty). As Carl Bergquist notes, the GTK compose key sequences for macrons are inconsistent: compose + - + a -> ã compose + - + i -> ī compose + - + u -> ū compose + - + e -> ē compose + - + o -> õ compose + _ + a -> ª compose + _ + i -> ī compose + _ + u -> ū compose + _ + e -> ē compose + _ + o -> º Given that there already exists a separate perfectly good compose sequence for adding a tilde (compose + ~ + <vowel>), I am more than a little baffled why the above inconsistency exists. This is poor usability, and I strongly request that the compose key sequences for macrons be unified, such that compose + - or _ + <vowel> properly outputs that vowel with a macron. Different behaviour for different vowels is confusing and unacceptable.
Eiríkr, please see #557420.
Thanks, just reported there too -- saw that one after this one.
*** This bug has been marked as a duplicate of bug 721120 ***