GNOME Bugzilla – Bug 165278
Range of each PangoAttr of preedit string is wrong when using imime.
Last modified: 2005-02-03 20:52:04 UTC
Please describe the problem: When using imime on windows, length of attributes of preedit string seems wrong. Please see the following picutre: http://www.homa.ne.jp/~ashie/linux/images/imime-bug-01.jpg Actual length of the first segment is 2 characters in Japanese (which is indicated by candidate window), but length of it on preedit string is 4 characters (which is indidated by double under line). Steps to reproduce: 1. Select "Windows IME" from input method menu on input widget like GtkEntry. 2. Activate MS-IME 3. Type following text: "watashinonamaehanakanodesu" 4. Convert the string to Japanese by pressing the space key. 5. Show the candidate window by pressing the space key. Actual results: Length of selected segment is wrong with real segment length. The length of selected segment indidated by double under line seems to be long twice compared with real segment length. Expected results: Both of segment length should be corresponded. Does this happen every time? every time. Other information: Currently ImmGetCompositionStringW() is used in get_utf8_preedit_string() (in modules/input/gtkimcontextime.c) to get preedit string. On the other hand, ImmGetCompositionStrinA() is used in get_pango_attr_list() to get text attributes. As a result, both length never be matched. To get attributes, ImmGetCompotionStringW() should be used.
Takuro, can you provide a patch for this ?
Created attachment 36939 [details] [review] replace ImmGetCompositionStringA with ImmGetCompositionStringW
Thanks, patch applied to HEAD and gtk-2-6. 2005-02-03 Tor Lillqvist <tml@novell.com> * modules/input/gtkimcontextime.c (get_pango_attr_list): Use the wide character version of ImmGetCompositionString() here, too. (#165278, Takuro Ashie)