After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 155010 - Configurable compose tables for gtkimcontextsimple.c (patch)
Configurable compose tables for gtkimcontextsimple.c (patch)
Status: RESOLVED DUPLICATE of bug 721120
Product: gtk+
Classification: Platform
Component: Input Methods
2.5.x
Other All
: High enhancement
: Medium feature
Assigned To: Hidetoshi Tajima
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2004-10-10 12:39 UTC by Leonard Michlmayr
Modified: 2015-08-05 22:17 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Compose table patch for Gtk+ (21.34 KB, patch)
2004-10-10 12:44 UTC, Leonard Michlmayr
none Details | Review
Compose table patch for gnome-control-center/gnome-settings-daemon (984 bytes, patch)
2004-10-10 12:53 UTC, Leonard Michlmayr
none Details | Review

Description Leonard Michlmayr 2004-10-10 12:39: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.
Comment 1 Leonard Michlmayr 2004-10-10 12:44:11 UTC
Created attachment 32440 [details] [review]
Compose table patch for Gtk+
Comment 2 Leonard Michlmayr 2004-10-10 12:53:47 UTC
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)
Comment 3 Leonard Michlmayr 2005-06-13 16:20:03 UTC
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.
Comment 4 Simos Xenitellis 2006-04-01 14:23:58 UTC
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 Ō).
Comment 5 Carl Bergquist 2007-02-04 23:43:57 UTC
(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 -> º



Comment 6 Simos Xenitellis 2007-02-06 06:57:09 UTC
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).
Comment 7 Eiríkr Útlendi 2009-05-18 16:08:47 UTC
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.  
Comment 8 Simos Xenitellis 2009-05-18 16:13:32 UTC
Eiríkr, please see #557420.
Comment 9 Eiríkr Útlendi 2009-05-18 16:22:08 UTC
Thanks, just reported there too -- saw that one after this one.  
Comment 10 Matthias Clasen 2015-08-05 22:17:03 UTC

*** This bug has been marked as a duplicate of bug 721120 ***