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 165278 - Range of each PangoAttr of preedit string is wrong when using imime.
Range of each PangoAttr of preedit string is wrong when using imime.
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Input Methods
2.6.x
Other Windows
: Normal major
: ---
Assigned To: Hidetoshi Tajima
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2005-01-26 09:09 UTC by Takuro Ashie
Modified: 2005-02-03 20:52 UTC
See Also:
GNOME target: ---
GNOME version: 2.5/2.6


Attachments
replace ImmGetCompositionStringA with ImmGetCompositionStringW (706 bytes, patch)
2005-02-03 19:27 UTC, Takuro Ashie
none Details | Review

Description Takuro Ashie 2005-01-26 09:09:50 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.
Comment 1 Matthias Clasen 2005-02-03 14:32:05 UTC
Takuro, can you provide a patch for this ?
Comment 2 Takuro Ashie 2005-02-03 19:27:49 UTC
Created attachment 36939 [details] [review]
replace ImmGetCompositionStringA with ImmGetCompositionStringW
Comment 3 Tor Lillqvist 2005-02-03 20:52:04 UTC
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)