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-20 13:58:43 +0300 |
commit | 8b12177e3de107c3ca2535536c581d894fb525ec (patch) | |
tree | dfc13529f7c6d9a032772b347ece1d3bf2c36730 | |
parent | e1b71defdb3eb4ea13b694a6357521ddc8780155 (diff) | |
download | jdk8u_jdk-8b12177e3de107c3ca2535536c581d894fb525ec.tar.gz |
JRE-742 [windows] IME candidate window position is wrong on HiDPI displajb8u152-b1136.35jb8u152-b1136.34
JR-CR-269
(cherry picked from commit 01e7954)
-rw-r--r-- | src/windows/native/sun/windows/awt_Component.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/windows/native/sun/windows/awt_Component.cpp b/src/windows/native/sun/windows/awt_Component.cpp index 41ba299dfc..5b8d72862d 100644 --- a/src/windows/native/sun/windows/awt_Component.cpp +++ b/src/windows/native/sun/windows/awt_Component.cpp @@ -3865,13 +3865,14 @@ 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; 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); } if (m_bitsCandType != 0) { // REMIND: is there any chance GetProxyFocusOwner() returns NULL here? |