< prev index next >
src/java.desktop/windows/native/libawt/windows/awt_Component.cpp
Print this page
*** 3822,3850 ****
}
for (int iCandType=0; iCandType<32; iCandType++, bits<<=1) {
if ( m_bitsCandType & bits )
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)
{
HWND hwnd = ImmGetHWnd();
HIMC hIMC = ImmGetContext(hwnd);
CANDIDATEFORM cf;
- cf.dwIndex = iCandType;
cf.dwStyle = CFS_POINT;
! cf.ptCurrentPos.x = x;
! cf.ptCurrentPos.y = y;
!
ImmSetCandidateWindow(hIMC, &cf);
ImmReleaseContext(hwnd, hIMC);
}
MsgRouting AwtComponent::WmImeSetContext(BOOL fSet, LPARAM *lplParam)
{
// If the Windows input context is disabled, do not let Windows
--- 3822,3851 ----
}
for (int iCandType=0; iCandType<32; iCandType++, bits<<=1) {
if ( m_bitsCandType & bits )
SetCandidateWindow(iCandType, x - p.x, y - p.y);
}
}
void AwtComponent::SetCandidateWindow(int iCandType, int x, int y)
{
HWND hwnd = ImmGetHWnd();
HIMC hIMC = ImmGetContext(hwnd);
+ if (hIMC) {
CANDIDATEFORM cf;
cf.dwStyle = CFS_POINT;
! ImmGetCandidateWindow(hIMC, 0, &cf);
! POINT curPos = cf.ptCurrentPos;
! if (x != curPos.x || y != curPos.y) {
! cf.dwIndex = iCandType;
! cf.dwStyle = CFS_POINT | CFS_FORCE_POSITION;
! cf.ptCurrentPos = {x, y};
! cf.rcArea = {0, 0, 0, 0};
ImmSetCandidateWindow(hIMC, &cf);
+ }
ImmReleaseContext(hwnd, hIMC);
+ }
}
MsgRouting AwtComponent::WmImeSetContext(BOOL fSet, LPARAM *lplParam)
{
// If the Windows input context is disabled, do not let Windows
*** 3868,3888 ****
}
MsgRouting AwtComponent::WmImeNotify(WPARAM subMsg, LPARAM bitsCandType)
{
if (!m_useNativeCompWindow) {
! if (subMsg == IMN_OPENCANDIDATE) {
m_bitsCandType = bitsCandType;
InquireCandidatePosition();
} else if (subMsg == IMN_OPENSTATUSWINDOW ||
! subMsg == WM_IME_STARTCOMPOSITION) {
! m_bitsCandType = 0;
! InquireCandidatePosition();
! } else if (subMsg == IMN_SETCANDIDATEPOS) {
InquireCandidatePosition();
}
- return mrConsume;
}
return mrDoDefault;
}
MsgRouting AwtComponent::WmImeStartComposition()
--- 3869,3886 ----
}
MsgRouting AwtComponent::WmImeNotify(WPARAM subMsg, LPARAM bitsCandType)
{
if (!m_useNativeCompWindow) {
! if (subMsg == IMN_OPENCANDIDATE || subMsg == IMN_CHANGECANDIDATE) {
m_bitsCandType = bitsCandType;
InquireCandidatePosition();
} else if (subMsg == IMN_OPENSTATUSWINDOW ||
! subMsg == WM_IME_STARTCOMPOSITION ||
! subMsg == IMN_SETCANDIDATEPOS) {
InquireCandidatePosition();
}
}
return mrDoDefault;
}
MsgRouting AwtComponent::WmImeStartComposition()
*** 3890,3901 ****
if (m_useNativeCompWindow) {
RECT rc;
::GetClientRect(GetHWnd(), &rc);
SetCompositionWindow(rc);
return mrDoDefault;
! } else
return mrConsume;
}
MsgRouting AwtComponent::WmImeEndComposition()
{
if (m_useNativeCompWindow) return mrDoDefault;
--- 3888,3901 ----
if (m_useNativeCompWindow) {
RECT rc;
::GetClientRect(GetHWnd(), &rc);
SetCompositionWindow(rc);
return mrDoDefault;
! } else {
! InquireCandidatePosition();
return mrConsume;
+ }
}
MsgRouting AwtComponent::WmImeEndComposition()
{
if (m_useNativeCompWindow) return mrDoDefault;
< prev index next >