8076455: IME Composition Window is displayed on incorrect position
authorbae
Fri, 24 Apr 2015 15:45:25 +0300
changeset 30480 f177387fbfc1
parent 30479 09cccadb5831
child 30481 13ab4bf3c34a
8076455: IME Composition Window is displayed on incorrect position Reviewed-by: serb, azvegint
jdk/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp
--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp	Thu Apr 23 17:33:19 2015 +0300
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp	Fri Apr 24 15:45:25 2015 +0300
@@ -3742,12 +3742,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?