diff options
author | Anton Tarasov <anton.tarasov@jetbrains.com> | 2018-04-18 19:04:16 +0300 |
---|---|---|
committer | Anton Tarasov <anton.tarasov@jetbrains.com> | 2018-04-18 19:32:40 +0300 |
commit | 6a065314435d25e54cb5ff0656ffcc1b88aaa670 (patch) | |
tree | f3a0557e300be8ab786d862b79eb59aa0a8206e1 | |
parent | 36f0e346a9067d18e3d617b15e75f0e92a18064e (diff) | |
download | jdk8u_jdk-jb8u152-b1226.9.tar.gz |
JRE-742 [windows] IME candidate window position is wrong on HiDPI displajb8u152-b1226.9
(cherry picked from commit 01e7954)
-rw-r--r-- | src/windows/native/sun/windows/awt_Component.cpp | 8 |
1 files 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 588ade8e7b..cad362138d 100644 --- a/src/windows/native/sun/windows/awt_Component.cpp +++ b/src/windows/native/sun/windows/awt_Component.cpp @@ -3866,16 +3866,18 @@ void AwtComponent::OpenCandidateWindow(int x, int y) { UINT bits = 1; POINT p = {0, 0}; // upper left corner of the client area - HWND hWnd = GetHWnd(); + HWND hWnd = ImmGetHWnd(); HWND hTop = GetTopLevelParentForWindow(hWnd); ::ClientToScreen(hTop, &p); + int sx = ScaleUpDX(x) - p.x; + int sy = ScaleUpDY(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); } } |