6853146: Regression: on-the-spot input is broken in AWT Peered components
Reviewed-by: art, ant, naoto
--- a/jdk/src/windows/native/sun/windows/awt_TextComponent.cpp Thu Apr 28 20:14:30 2011 +0400
+++ b/jdk/src/windows/native/sun/windows/awt_TextComponent.cpp Thu Apr 28 19:23:44 2011 +0400
@@ -191,8 +191,11 @@
{
HIMC hIMC = ImmGetContext();
// rc is not used for text component.
- COMPOSITIONFORM cf = { CFS_POINT, {0,0}, {0,0,0,0} };
+ COMPOSITIONFORM cf = { CFS_FORCE_POSITION, {0,0}, {0,0,0,0} };
GetCaretPos(&(cf.ptCurrentPos));
+ // the proxy is the native focus owner and it contains the composition window
+ // let's convert the position to a coordinate space relative to proxy
+ ::MapWindowPoints(GetHWnd(), GetProxyFocusOwner(), (LPPOINT)&cf.ptCurrentPos, 1);
ImmSetCompositionWindow(hIMC, &cf);
LOGFONT lf;