6853146: Regression: on-the-spot input is broken in AWT Peered components
authordcherepanov
Thu, 28 Apr 2011 19:23:44 +0400
changeset 9479 ea7a57569d30
parent 9478 d34a5a70203a
child 9480 d8dd7ecdfb05
6853146: Regression: on-the-spot input is broken in AWT Peered components Reviewed-by: art, ant, naoto
jdk/src/windows/native/sun/windows/awt_TextComponent.cpp
--- 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;