changeset 4082:5b001da8768e

6853146: Regression: on-the-spot input is broken in AWT Peered components Reviewed-by: art, ant, naoto
author dcherepanov
date Thu, 28 Apr 2011 19:23:44 +0400
parents b1567059e4fe
children 43be19b7c945
files src/windows/native/sun/windows/awt_TextComponent.cpp
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/windows/native/sun/windows/awt_TextComponent.cpp	Thu Apr 28 20:14:30 2011 +0400
+++ b/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;