changeset 9138:ec5259fc4b04

8076455: IME Composition Window is displayed on incorrect position Reviewed-by: serb, azvegint
author bae
date Fri, 24 Apr 2015 19:44:15 +0300
parents ef86adcabe4c
children 34888f07a385
files src/windows/native/sun/windows/awt_Component.cpp
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/windows/native/sun/windows/awt_Component.cpp	Fri Jul 15 19:25:06 2011 +0400
+++ b/src/windows/native/sun/windows/awt_Component.cpp	Fri Apr 24 19:44:15 2015 +0300
@@ -3743,12 +3743,14 @@
 void AwtComponent::OpenCandidateWindow(int x, int y)
 {
     UINT bits = 1;
-    RECT rc;
-    GetWindowRect(GetHWnd(), &rc);
+    POINT p = {0, 0}; // upper left corner of the client area
+    HWND hWnd = GetHWnd();
+    HWND hTop = GetTopLevelParentForWindow(hWnd);
+    ::ClientToScreen(hTop, &p);
 
     for (int iCandType=0; iCandType<32; iCandType++, bits<<=1) {
         if ( m_bitsCandType & bits )
-            SetCandidateWindow(iCandType, x-rc.left, y-rc.top);
+            SetCandidateWindow(iCandType, x - p.x, y - p.y);
     }
     if (m_bitsCandType != 0) {
         // REMIND: is there any chance GetProxyFocusOwner() returns NULL here?