From 6ff7e6782003bcc2e4f62a61f7e9da51e0b5249a Mon Sep 17 00:00:00 2001 From: bae Date: Fri, 24 Apr 2015 19:44:15 +0300 Subject: [PATCH] 8076455: IME Composition Window is displayed on incorrect position Reviewed-by: serb, azvegint --- src/windows/native/sun/windows/awt_Component.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/windows/native/sun/windows/awt_Component.cpp b/src/windows/native/sun/windows/awt_Component.cpp index 3baae0f6d..5a295907a 100644 --- a/src/windows/native/sun/windows/awt_Component.cpp +++ b/src/windows/native/sun/windows/awt_Component.cpp @@ -3761,12 +3761,14 @@ void AwtComponent::SetCompositionWindow(RECT& r) 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? -- GitLab