Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 381974

Summary: DBCS4.2: Can not choose Hanzi on Text editor with AIX T/S-Chinese IME
Product: [Eclipse Project] Platform Reporter: Kentaroh Noji <kennoji>
Component: SWTAssignee: Silenio Quarti <Silenio_Quarti>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: camle, daniel_megert, gheorghe, harendra, Silenio_Quarti
Version: 4.2   
Target Milestone: 4.3 M3   
Hardware: Other   
OS: AIX   
Whiteboard:
Attachments:
Description Flags
Screen capture 1
none
Screen capture 2
none
Screen capture 3
none
Screen capture 1
none
Potential patch none

Description Kentaroh Noji CLA 2012-06-07 05:46:00 EDT
Build Identifier: I20120524-2100

OS: AIX v7.1.0.0
JDK: java full version JRE 1.7.0 IBM AIX build pap3270-20110827_01
Locale: Zh_CN.GB18030, Zh_TW.big5

AIX Chinese IME provides Hanzi selection window to display Hanzi candidate characters. I can not choose any Hanzi characters in the Hanzi selection window on AIX. This problem happens on both S-Chinese locale (Zh_CN) and T-Chinese locale (Zh_TW). 

As for Windows S-Chinese IME, I can select Hanzi successfully. 

Reproducible: Always

Steps to Reproduce:
Steps to recreate problem:
1. Login AIX with Zh_TW.big5 locale. 
2. Start eclipse. 
3. Create a project.
4. Create a Untitled Text File in the project.
5. Type Ctrl + Alt on the editor, then Chinese IME is invoked. The IME window comes up under the Eclipse window. 
6. Type C + L + Space key. Then Hanji selection window comes up in the text editor. (screen capture 1) 
7. Type "1" to chose a Hanzi character. However, the Hanzi characters are not accepted. 

When I use Chinese IME in terminal window, I can chose a Hanzi Character. (screen capture 2)
The same problem happens in Zh_CN.GB18030 locale.
Instead of Step 6, type S + L + Space, and then a Hanzi character is accepted successfully. This is because this key combination does not need Hanji selection window,  I think.
Comment 1 Kentaroh Noji CLA 2012-06-07 05:47:00 EDT
Created attachment 217006 [details]
Screen capture 1
Comment 2 Kentaroh Noji CLA 2012-06-07 05:47:24 EDT
Created attachment 217007 [details]
Screen capture 2
Comment 3 Kentaroh Noji CLA 2012-06-07 05:48:33 EDT
Created attachment 217008 [details]
Screen capture 3
Comment 4 Kentaroh Noji CLA 2012-06-07 05:50:33 EDT
Created attachment 217009 [details]
Screen capture 1
Comment 5 Dani Megert CLA 2012-06-07 06:13:19 EDT
This looks like an SWT problem.

Kentaroh, can you please try with
- in a simple text entry field in Eclipse
- an SWT StyledText snippet, e.g.
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet163.java
Comment 6 Dani Megert CLA 2012-06-07 06:14:38 EDT
Also, are you using GTK or Motif (please set the Platform fields in this bug report)?
Comment 7 Kentaroh Noji CLA 2012-06-07 21:20:48 EDT
(In reply to comment #5)
> This looks like an SWT problem.
> 
> Kentaroh, can you please try with
> - in a simple text entry field in Eclipse
> - an SWT StyledText snippet, e.g.
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet163.java

Yes, I could reproduce the same problem with Snippet163.java. Also, I changed the platform from others to AIX GTK.
Comment 8 Bogdan Gheorghe CLA 2012-06-14 17:06:48 EDT
We don't an AIX machine setup with Chinese locales. Would it be able to arrange for a temporary account on your machine for us to try it out?
Comment 9 Bogdan Gheorghe CLA 2012-06-15 15:05:06 EDT
Created attachment 217445 [details]
Potential patch

Here is a patch for this bug. We left Eclipse open on the VNC machine. We applied this patch to the loaded code and ran an inner Eclipse for you to test.

Could you please give the inner Eclipse a try and see if this patch fixes the problem for you? Thanks!
Comment 10 Kentaroh Noji CLA 2012-06-18 22:13:24 EDT
I have verified that the text editor with the patch successfully accepted Chinese Hanzi characters, and looks great.
Comment 11 Bogdan Gheorghe CLA 2012-07-30 11:02:09 EDT
Patch released to master.
Comment 12 Silenio Quarti CLA 2012-10-22 12:02:07 EDT
This caused bug#391459.
Comment 13 Silenio Quarti CLA 2012-10-22 12:32:02 EDT
These changes have been removed because of bug#391459.

This problem does not happen on Linux (RedHat 6, Fedora 15). The problem happens on AIX because the IME window is taking focus away from the text widget.  We need to find a different fix for this.  We are getting VNCSERVER installed on our AIX box in order to work on this problem. The IME does not work properly when accessing the machine by SSH.
Comment 14 Silenio Quarti CLA 2012-10-23 11:46:35 EDT
This patch fix the problem using a different strategy.  It only calls filterKey() for unfocused widgets when the active shell is null. This is the case when the IME window steals focus away from the shell.

I have tested this on our AIX box and everything seems to work fine. 

Kentaroh Noji, please could you retest this new fix? Thanks!

http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=26bd6aad3363f6d1b254085e150b94f64d1b104f
Comment 15 Kentaroh Noji CLA 2012-10-23 21:47:00 EDT
(In reply to comment #14)
> 
> Kentaroh Noji, please could you retest this new fix? Thanks!

Sure, I will verify this when the next build contains the fix. Thanks.