aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tarasov <anton.tarasov@jetbrains.com>2018-04-18 19:04:16 +0300
committerAnton Tarasov <anton.tarasov@jetbrains.com>2018-04-18 19:32:40 +0300
commit6a065314435d25e54cb5ff0656ffcc1b88aaa670 (patch)
treef3a0557e300be8ab786d862b79eb59aa0a8206e1
parent36f0e346a9067d18e3d617b15e75f0e92a18064e (diff)
downloadjdk8u_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.cpp8
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);
}
}