# HG changeset patch # User ant # Date 1524673482 -19800 # Node ID 48637783b4f628146c9058940851cf96405d1625 # Parent b6f4bd0bf17397a527cfba145ac37b70824376b0 8189687: Swing: Invalid position of candidate pop-up of InputMethod in Hi-DPI on Windows Reviewed-by: serb, psadhukhan Contributed-by: anton.tarasov@jetbrains.com diff -r b6f4bd0bf173 -r 48637783b4f6 src/java.desktop/windows/native/libawt/windows/awt_Component.cpp --- a/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp Tue Apr 24 15:42:58 2018 +0100 +++ b/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp Wed Apr 25 21:54:42 2018 +0530 @@ -3880,19 +3880,21 @@ { UINT bits = 1; POINT p = {0, 0}; // upper left corner of the client area - HWND hWnd = GetHWnd(); + HWND hWnd = ImmGetHWnd(); if (!::IsWindowVisible(hWnd)) { return; } HWND hTop = GetTopLevelParentForWindow(hWnd); ::ClientToScreen(hTop, &p); + int sx = ScaleUpX(x) - p.x; + int sy = ScaleUpY(y) - p.y; if (!m_bitsCandType) { - SetCandidateWindow(m_bitsCandType, x - p.x, y - p.y); + SetCandidateWindow(m_bitsCandType, sx, sy); return; } for (int iCandType=0; iCandType<32; iCandType++, bits<<=1) { if ( m_bitsCandType & bits ) - SetCandidateWindow(iCandType, x - p.x, y - p.y); + SetCandidateWindow(iCandType, sx, sy); } }