<i18n dev> <AWT Dev> RFR: 8213232 Unix/X11 setCompositionEnableNative issue

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Thu Apr 11 02:19:18 UTC 2019


Hi, Ichiroh.

Why the fix uses the "defined(MACOSX)" in a few places? I assume this code is never executed on macOS.
Should we update the aix version as well?
.../java.desktop/aix/native/libawt_xawt/awt/awt_InputMethod.c

On 25/03/2019 09:28, Ichiroh Takiguchi wrote:
> Hello.
> 
> Could you review the fix and give me your suggestion, please ?
> I really appreciate your feedback.
> 
> Currently, UnsupportedOperationException happens because of invalid usage
> by input method operation.
> 
> And I'd like to obtain a sponsor for this issue.
> 
> Thanks,
> Ichiroh Takiguchi
> 
> On 2019-03-11 22:00, Ichiroh Takiguchi wrote:
>> Hello.
>>
>> Could you review the fix and give me your suggestion, please ?
>>
>> Thanks,
>> Ichiroh Takiguchi
>>
>> On 2019-02-26 22:08, Ichiroh Takiguchi wrote:
>>> Hello.
>>>
>>> Could you review the fix ?
>>>
>>> Bug:    https://bugs.openjdk.java.net/browse/JDK-8213232
>>> Change: https://cr.openjdk.java.net/~itakiguchi/8213232/webrev.01/
>>>
>>> JDK-8213232 [1] has movies.
>>> Please check it.
>>>
>>> I applied following changes on webrev.01:
>>> 1. According to "Xlib - C Language X Interface" [2]
>>>    See "Preedit State Callbacks" section:
>>>    PreeditStartCallback() should return int.
>>> 2. Add 64bit Big Endian CPU support, like s390x
>>> 3. Change copyright year
>>>
>>> [1] https://bugs.openjdk.java.net/browse/JDK-8213232
>>> [2] https://www.x.org/releases/X11R7.6/doc/libX11/specs/libX11/libX11.html
>>>
>>> Thanks,
>>> Ichiroh Takiguchi
>>> IBM Japan, Ltd.
>>>
>>> On 2018-12-04 11:22, Ichiroh Takiguchi wrote:
>>>> Hello.
>>>>
>>>> Could you review the fix ?
>>>>
>>>> Bug:    https://bugs.openjdk.java.net/browse/JDK-8213232
>>>> Change: https://cr.openjdk.java.net/~itakiguchi/8213232/webrev.00/
>>>>
>>>> This issue is related by wrong usage of XNPreeditState on XSetICValues().
>>>> Because of wrong usage, UnsupportedOperationException exception
>>>> happened with Xlib bundled input method.
>>>> Test instructions is in JDK-8213232.
>>>>
>>>> I'd like to obtain a sponsor for this issue.
>>>>
>>>> Thanks,
>>>> Ichiroh Takiguchi
>>>> IBM Japan, Ltd.
>>>>
>>>> On 2018-06-19 02:15, Ichiroh Takiguchi wrote:
>>>>> Hello,
>>>>> IBM would like to contribute Unix/X11 setCompositionEnableNative issue
>>>>> patch to OpenJDK project.
>>>>>
>>>>> Issue:
>>>>> To  turn on or turn off IME via Java, XNPreeditState should be used
>>>>> with XSetValues().
>>>>> But it should be nested via XVaCreateNestedList() since XNPreeditState
>>>>> is a part of XNPreeditAttributes.
>>>>> Current code is, like:
>>>>> -    ret = XSetICValues(pX11IMData->current_ic, XNPreeditState,
>>>>> -                       (enable ? XIMPreeditEnable : XIMPreeditDisable), NULL);
>>>>> But it should be, like:
>>>>> +    pr_atrb = XVaCreateNestedList(0,
>>>>> +                  XNPreeditState, (enable ? XIMPreeditEnable :
>>>>> XIMPreeditDisable),
>>>>> +                  NULL);
>>>>> +    ret = XSetICValues(pX11IMData->current_ic, XNPreeditAttributes,
>>>>> pr_atrb, NULL);
>>>>>
>>>>> On Linux platform, the issue can check with following test program and
>>>>> kinput2 XIM server and
>>>>> Wnn8 for Linux/BSD (htt).
>>>>> ==================
>>>>> import java.awt.*;
>>>>> import java.awt.event.*;
>>>>> import javax.swing.*;
>>>>>
>>>>> public class CompositionEnabledTest extends JFrame {
>>>>>   CompositionEnabledTest() {
>>>>>     Container c = getContentPane();
>>>>>     c.setLayout(new GridLayout(0,2));
>>>>>     JButton btn;
>>>>>     JTextField tf;
>>>>>     btn = new JButton("Undefined");
>>>>>     c.add(btn);
>>>>>     tf = new JTextField("Undefined");
>>>>>     c.add(tf);
>>>>>     btn = new JButton("Disabled");
>>>>>     btn.addFocusListener(new MyFocusListener(false));
>>>>>     c.add(btn);
>>>>>     tf = new JTextField("Disabled");
>>>>>     tf.addFocusListener(new MyFocusListener(false));
>>>>>     c.add(tf);
>>>>>     btn = new JButton("Enabled");
>>>>>     btn.addFocusListener(new MyFocusListener(true));
>>>>>     c.add(btn);
>>>>>     tf = new JTextField("Enabled");
>>>>>     tf.addFocusListener(new MyFocusListener(true));
>>>>>     c.add(tf);
>>>>>     setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>>>>>     pack();
>>>>>     setVisible(true);
>>>>>   }
>>>>>   class MyFocusListener implements FocusListener {
>>>>>     boolean state;
>>>>>     MyFocusListener(boolean state) {
>>>>>       this.state = state;
>>>>>     }
>>>>>     public void focusGained(FocusEvent fe) {
>>>>> fe.getComponent().getInputContext().setCompositionEnabled(state);
>>>>>     }
>>>>>     public void focusLost(FocusEvent fe) { }
>>>>>   }
>>>>>   public static void main(String[] args) {
>>>>>     new CompositionEnabledTest();
>>>>>   }
>>>>> }
>>>>> ==================
>>>>>
>>>>> Click JTextField and JButton, then XIM server status may be changed.
>>>>> If XIM server does not support XNPreeditState, it does not work.
>>>>>
>>>>> I'd like contribute following 3 files:
>>>>> M src/java.desktop/share/classes/sun/awt/im/InputContext.java
>>>>> M src/java.desktop/unix/classes/sun/awt/X11InputMethod.java
>>>>> M src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c
>>>>>
>>>>> http://cr.openjdk.java.net/~aleonard/set_composition_enabled/webrev.00/
>>>>>
>>>>> I appreciate any feedback please, and how I would go about obtaining a
>>>>> sponsor and contributor?
>>>>>
>>>>> Thanks,
>>>>> Ichiroh Takiguchi
>>>>> IBM Japan, Ltd.
> 


-- 
Best regards, Sergey.


More information about the i18n-dev mailing list