提交 a73c6a39 编写于 作者: S ssreedharan

8183504: 8u131 Win 10, issue with wrong position of Sogou IME popup

Reviewed-by: psadhukhan
上级 6d06137a
...@@ -3849,25 +3849,36 @@ void AwtComponent::OpenCandidateWindow(int x, int y) ...@@ -3849,25 +3849,36 @@ void AwtComponent::OpenCandidateWindow(int x, int y)
if ( m_bitsCandType & bits ) if ( m_bitsCandType & bits )
SetCandidateWindow(iCandType, x - p.x, y - p.y); SetCandidateWindow(iCandType, x - p.x, y - p.y);
} }
if (m_bitsCandType != 0) {
// REMIND: is there any chance GetProxyFocusOwner() returns NULL here?
::DefWindowProc(ImmGetHWnd(),
WM_IME_NOTIFY, IMN_OPENCANDIDATE, m_bitsCandType);
}
} }
void AwtComponent::SetCandidateWindow(int iCandType, int x, int y) void AwtComponent::SetCandidateWindow(int iCandType, int x, int y)
{ {
HWND hwnd = ImmGetHWnd(); HWND hwnd = ImmGetHWnd();
HIMC hIMC = ImmGetContext(hwnd); HIMC hIMC = ImmGetContext(hwnd);
CANDIDATEFORM cf; if (hIMC) {
cf.dwIndex = iCandType; CANDIDATEFORM cf;
cf.dwStyle = CFS_POINT; cf.dwStyle = CFS_POINT;
cf.ptCurrentPos.x = x; ImmGetCandidateWindow(hIMC, 0, &cf);
cf.ptCurrentPos.y = y; if (x != cf.ptCurrentPos.x || y != cf.ptCurrentPos.y) {
cf.dwIndex = iCandType;
ImmSetCandidateWindow(hIMC, &cf); cf.dwStyle = CFS_POINT;
ImmReleaseContext(hwnd, hIMC); cf.ptCurrentPos.x = x;
cf.ptCurrentPos.y = y;
cf.rcArea.left = cf.rcArea.top = cf.rcArea.right = cf.rcArea.bottom = 0;
ImmSetCandidateWindow(hIMC, &cf);
}
COMPOSITIONFORM cfr;
cfr.dwStyle = CFS_POINT;
ImmGetCompositionWindow(hIMC, &cfr);
if (x != cfr.ptCurrentPos.x || y != cfr.ptCurrentPos.y) {
cfr.dwStyle = CFS_POINT;
cfr.ptCurrentPos.x = x;
cfr.ptCurrentPos.y = y;
cfr.rcArea.left = cfr.rcArea.top = cfr.rcArea.right = cfr.rcArea.bottom = 0;
ImmSetCompositionWindow(hIMC, &cfr);
}
ImmReleaseContext(hwnd, hIMC);
}
} }
MsgRouting AwtComponent::WmImeSetContext(BOOL fSet, LPARAM *lplParam) MsgRouting AwtComponent::WmImeSetContext(BOOL fSet, LPARAM *lplParam)
...@@ -3895,17 +3906,14 @@ MsgRouting AwtComponent::WmImeSetContext(BOOL fSet, LPARAM *lplParam) ...@@ -3895,17 +3906,14 @@ MsgRouting AwtComponent::WmImeSetContext(BOOL fSet, LPARAM *lplParam)
MsgRouting AwtComponent::WmImeNotify(WPARAM subMsg, LPARAM bitsCandType) MsgRouting AwtComponent::WmImeNotify(WPARAM subMsg, LPARAM bitsCandType)
{ {
if (!m_useNativeCompWindow) { if (!m_useNativeCompWindow) {
if (subMsg == IMN_OPENCANDIDATE) { if (subMsg == IMN_OPENCANDIDATE || subMsg == IMN_CHANGECANDIDATE) {
m_bitsCandType = bitsCandType; m_bitsCandType = bitsCandType;
InquireCandidatePosition(); InquireCandidatePosition();
} else if (subMsg == IMN_OPENSTATUSWINDOW || } else if (subMsg == IMN_OPENSTATUSWINDOW ||
subMsg == WM_IME_STARTCOMPOSITION) { subMsg == WM_IME_STARTCOMPOSITION ||
m_bitsCandType = 0; subMsg == IMN_SETCANDIDATEPOS) {
InquireCandidatePosition();
} else if (subMsg == IMN_SETCANDIDATEPOS) {
InquireCandidatePosition(); InquireCandidatePosition();
} }
return mrConsume;
} }
return mrDoDefault; return mrDoDefault;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册