diff --git a/gtk/gtkcomposetable.c b/gtk/gtkcomposetable.c index b8842d9731..538003923a 100644 --- a/gtk/gtkcomposetable.c +++ b/gtk/gtkcomposetable.c @@ -1331,11 +1331,28 @@ gtk_compose_table_check (const GtkComposeTable *table, if (!seq_index) return FALSE; - if (n_compose == 1) - return TRUE; - match = FALSE; + if (n_compose == 1) + { + if (seq_index[2] - seq_index[1] > 0) + { + seq = table->data + seq_index[1]; + + value = seq[0]; + + if ((value & (1 << 15)) != 0) + g_string_append (output, &table->char_data[value & ~(1 << 15)]); + else + g_string_append_unichar (output, value); + + if (compose_match) + *compose_match = TRUE; + } + + return TRUE; + } + for (i = n_compose - 1; i < table->max_seq_len; i++) { len = i + 1; diff --git a/gtk/gtkcomposetable.h b/gtk/gtkcomposetable.h index f6665e63c0..4597858f45 100644 --- a/gtk/gtkcomposetable.h +++ b/gtk/gtkcomposetable.h @@ -30,12 +30,13 @@ typedef struct _GtkComposeTableCompact GtkComposeTableCompact; * The first part of the data contains rows of length max_seq_len + 1, * where the first element is the item of the sequence, and the * following elements are offsets to the data for sequences that - * start with the first item of length 2, ..., max_seq_len. + * start with the first item of length 1, ..., max_seq_len. * * The second part of the data contains the rest of the sequence * data. It does not have a fixed stride. For each sequence, we * put seq[2], ..., seq[len - 1], followed by the encoded value - * for this sequence. + * for this sequence. In particular for a sequence of length 1, + * the offset points directly to the value. * * The values are encoded as follows: *