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

Bug 97177

Summary: [misc] Chinese IME status lost
Product: [Eclipse Project] Platform Reporter: Haibing <thefloe>
Component: SWTAssignee: Felipe Heidrich <eclipse.felipe>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert
Version: 3.1   
Target Milestone: 3.1 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Haibing CLA 2005-05-30 04:20:52 EDT
Open chinese IME in eclipse text editor,then switch to another window and 
switch back to Eclipse, chinese IME are closed, and have to open again.
Comment 1 Dani Megert CLA 2005-05-30 04:28:13 EDT
Does this only happen with Eclipse? I would assume that the IME window is
controlled by the OS.
Comment 2 Haibing CLA 2005-05-30 04:38:22 EDT
(In reply to comment #1)
> Does this only happen with Eclipse? I would assume that the IME window is
> controlled by the OS.

Yes, it only happen with eclipse.It seems only happen to eclipse text editor, I 
have noticed dialogs of eclipse does not lost IME status, such as Open Type 
dialog.
IME status is not IME window, I mean each time after change IME to chinese in 
eclipse text editor and input some chinese, then switch to some other 
application and switch back to eclipse, you have to change IME to chinese 
again. Normal application will keep the IME you have set until you change it 
again.
Comment 3 Dani Megert CLA 2005-05-30 05:04:16 EDT
Just tried it out and it works for me using 3.1 RC1, Windows XP, SP2:
1. install fresh 3.1RC1 Eclipse SDK, no additional plug-ins
2. create project P
3. create file f.txt
4. change ime to some other language 'L'
5. switch to other app ==> default language shown in ime
6. switch back to Eclipse ==> 'L' shown in ime status
Comment 4 Dani Megert CLA 2005-05-30 05:04:25 EDT
.
Comment 5 Haibing CLA 2005-05-30 05:22:30 EDT
(In reply to comment #4)
> .

Mmm, yes, the IME status in language bar are kept, but you could not input 
chinese in fact, must close IME and open IME again to input chinese.

I'm using 3.1 build200409240800, but had test this bug with 3.1M7 too.

Thank you for test and reply.
Comment 6 Dani Megert CLA 2005-05-30 05:29:46 EDT
Reopen to move to SWT for comment. There's nothing Platform Text does which
would cause this.
Comment 7 Felipe Heidrich CLA 2005-06-07 15:03:01 EDT
This is a side-effect caused by the fix for bug14656, the fix is in 
Shell#WM_ACTIVATE:
/*
* Bug in Windows XP.  When a Shell is deactivated, the
* IME composition window does not go away. This causes
* repaint issues.  The fix is to close the IME ourselves
* when the Shell is deactivated.
* 
* Note.  When the Shell is reactivated, the text in the
* composition window has been lost.
*/
if (OS.WIN32_VERSION >= OS.VERSION (5, 1)) {
	if ((wParam & 0xFFFF) == 0 && OS.IsDBLocale && hIMC != 0) {
		OS.ImmSetOpenStatus (hIMC, false);
	}
}

-- I can not remove this code cause I can't re-introduce Bug14656, the only 
chance here is to find some other fix for it. 
Comment 8 Felipe Heidrich CLA 2005-06-08 11:17:34 EDT
Fixed in HEAD > 20050608