[IMM32] Rewrite ImmNotifyIME (#3853)

Implementing Japanese input... CORE-11700
This commit is contained in:
Katayama Hirofumi MZ 2021-07-28 23:24:09 +09:00 committed by GitHub
parent a71de262d3
commit fb2aef9e4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2609,23 +2609,29 @@ BOOL WINAPI ImmIsUIMessageW(
BOOL WINAPI ImmNotifyIME(
HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue)
{
InputContextData *data = get_imc_data(hIMC);
DWORD dwImeThreadId, dwThreadId;
HKL hKL;
PIMEDPI pImeDpi;
BOOL ret;
TRACE("(%p, %d, %d, %d)\n",
hIMC, dwAction, dwIndex, dwValue);
TRACE("ImmNotifyIME(%p, %lu, %lu, %lu)\n", hIMC, dwAction, dwIndex, dwValue);
if (hIMC == NULL)
if (hIMC)
{
SetLastError(ERROR_SUCCESS);
return FALSE;
dwImeThreadId = Imm32QueryWindow(hIMC, QUERY_WINDOW_UNIQUE_THREAD_ID);
dwThreadId = GetCurrentThreadId();
if (dwImeThreadId != dwThreadId)
return FALSE;
}
if (!data || ! data->immKbd->pNotifyIME)
{
hKL = GetKeyboardLayout(0);
pImeDpi = ImmLockImeDpi(hKL);
if (pImeDpi == NULL)
return FALSE;
}
return data->immKbd->pNotifyIME(hIMC,dwAction,dwIndex,dwValue);
ret = pImeDpi->NotifyIME(hIMC, dwAction, dwIndex, dwValue);
ImmUnlockImeDpi(pImeDpi);
return ret;
}
/***********************************************************************