diff options
author | Yusuke Sato <yusukes@chromium.org> | 2011-02-03 10:15:24 +0900 |
---|---|---|
committer | Yusuke Sato <yusukes@chromium.org> | 2011-02-03 10:15:24 +0900 |
commit | 03c9e591430c62354bbf26ef7bd4a2e6acfb7c8f (patch) | |
tree | 68f7e584910730e17070d991d84b753289a7c5d8 /client | |
parent | 0e6fa20c2521c5e23fe2f5bdd17bcbdfcf227da8 (diff) |
Overwrite Gtk+'s default compose table to fix crosbug.com/11421.
BUG=chromium-os:11421
TEST=manually done on Chrome OS.
Review URL: http://codereview.appspot.com/3989060
Diffstat (limited to 'client')
-rw-r--r-- | client/gtk2/ibusimcontext.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c index b1ae0c84..745722fa 100644 --- a/client/gtk2/ibusimcontext.c +++ b/client/gtk2/ibusimcontext.c @@ -496,6 +496,24 @@ ibus_im_context_class_init (IBusIMContextClass *class) _key_snooper_id = gtk_key_snooper_install (_key_snooper_cb, NULL); } +/* Copied from gtk+2.0-2.20.1/modules/input/imcedilla.c to fix crosbug.com/11421. + * Overwrite the original Gtk+'s compose table in gtk+-2.x.y/gtk/gtkimcontextsimple.c. */ + +/* The difference between this and the default input method is the handling + * of C+acute - this method produces C WITH CEDILLA rather than C WITH ACUTE. + * For languages that use CCedilla and not acute, this is the preferred mapping, + * and is particularly important for pt_BR, where the us-intl keyboard is + * used extensively. + */ +static guint16 cedilla_compose_seqs[] = { + GDK_dead_acute, GDK_C, 0, 0, 0, 0x00C7, /* LATIN_CAPITAL_LETTER_C_WITH_CEDILLA */ + GDK_dead_acute, GDK_c, 0, 0, 0, 0x00E7, /* LATIN_SMALL_LETTER_C_WITH_CEDILLA */ + GDK_Multi_key, GDK_apostrophe, GDK_C, 0, 0, 0x00C7, /* LATIN_CAPITAL_LETTER_C_WITH_CEDILLA */ + GDK_Multi_key, GDK_apostrophe, GDK_c, 0, 0, 0x00E7, /* LATIN_SMALL_LETTER_C_WITH_CEDILLA */ + GDK_Multi_key, GDK_C, GDK_apostrophe, 0, 0, 0x00C7, /* LATIN_CAPITAL_LETTER_C_WITH_CEDILLA */ + GDK_Multi_key, GDK_c, GDK_apostrophe, 0, 0, 0x00E7, /* LATIN_SMALL_LETTER_C_WITH_CEDILLA */ +}; + static void ibus_im_context_init (GObject *obj) { @@ -528,6 +546,11 @@ ibus_im_context_init (GObject *obj) // Create slave im context ibusimcontext->slave = gtk_im_context_simple_new (); + gtk_im_context_simple_add_table (GTK_IM_CONTEXT_SIMPLE (ibusimcontext->slave), + cedilla_compose_seqs, + 4, + G_N_ELEMENTS (cedilla_compose_seqs) / (4 + 2)); + g_signal_connect (ibusimcontext->slave, "commit", G_CALLBACK (_slave_commit_cb), |