RFR: 8264728: When use chinese IME, the candidate box isn't moved with caret of JTextArea [v2]
Nikita Provotorov
duke at openjdk.org
Thu Aug 17 19:23:33 UTC 2023
On Thu, 16 Mar 2023 08:33:35 GMT, 柳鲲鹏 <duke at openjdk.org> wrote:
>> Candidat box can moving with caret on windows version. Someone must wrote codes for linux(ubuntu), but it doesn't work, so he didn't commit the codes. Why it doesn't work, is the key problem.
>>
>> 1, I wrote a example for linux:
>> https://github.com/quantum6/X11InputMethod
>>
>> I tried all parameters to test and as my research:
>> If you use XIMPreeditCallbacks to initiate, the box can't be moved with caret.
>> If you use XIMPreeditNothing, it works.
>> All examples use XIMPreeditCallbacks to initiate input method and candidate box can't moving. So I understand why he didn't commit the codes.
>>
>> 2, I traced the route of transfering caret coordites on windows version, then add codes for linux.
>> 3, Taishan Office(like Microsoft Office Word) is running on jdk, we tested for a long time, it works OK.
>> 4, I am not sure for AIX( no environment).
>>
>>
>> JDK-8264728 : When use chinese IME, the candidate box isn't moved with caret of JTextArea
>> Type: Bug
>> Component: client-libs
>> Sub-Component: java.awt:i18n
>> Affected Version: 8,9,15,16
>> Priority: P3
>> Status: Open
>> Resolution: Unresolved
>> OS: linux
>> CPU: x86_64
>
> 柳鲲鹏 has refreshed the contents of this pull request, and previous commits have been removed. Incremental views are not available. The pull request now contains one commit:
>
> 8264728: When use chinese IME, the candidate box isn't moved with caret of JTextArea
Changes requested by NikitkoCent at github.com (no known OpenJDK username).
src/java.desktop/unix/classes/sun/awt/X11/XInputMethod.java line 208:
> 206: y += temp.getY();
> 207: temp = parent;
> 208: }
Have you tried to use just _java.awt.Component#getLocationOnScreen_?
src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c line 870:
> 868: and block the candidate window to move with caret.
> 869: */
> 870: XIMStyle on_the_spot_styles = XIMPreeditNothing,
`XNSpotLocation` can't be used together with `XIMPreeditNothing`. Look at the [specification](https://www.x.org/releases/X11R7.6/doc/libX11/specs/libX11/libX11.html#Input_Methods) of `XNSpotLocation`:
> When specified to any input method other than XIMPreeditPosition, this XIC value is ignored.
So even if this works with some IM on some distribution, there is no guarantee that it works more or less everywhere.
-------------
PR Review: https://git.openjdk.org/jdk/pull/13055#pullrequestreview-1504160543
PR Review Comment: https://git.openjdk.org/jdk/pull/13055#discussion_r1245844264
PR Review Comment: https://git.openjdk.org/jdk/pull/13055#discussion_r1245804590
More information about the client-libs-dev
mailing list