[NTUSER] Remember old KL for Chinese IMEs (#5266)

The Chinese user uses Ctrl+Space key combination to switch between the IME keyboard and the non-IME keyboard. To enable Ctrl+Space, the system has to remember the previous keyboard layout. In IntImmActivateLayout function, remember the previous keyboard layout (hklPrev) to switch back for Chinese IMEs. CORE-18950
This commit is contained in:
Katayama Hirofumi MZ 2023-05-05 17:00:05 +09:00 committed by GitHub
parent df72bcd06c
commit 2d31b06c67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -650,14 +650,21 @@ IntImmActivateLayout(
co_IntSendMessage(hImeWnd, WM_IME_SYSTEM, IMS_ACTIVATELAYOUT, (LPARAM)pKL->hkl);
UserDerefObjectCo(pImeWnd);
}
else if (pti->spDefaultImc)
else
{
/* IME Activation is needed */
pti->pClientInfo->CI_flags |= CI_IMMACTIVATE;
/* Remember old keyboard layout to switch back for Chinese IMEs */
pti->hklPrev = pti->KeyboardLayout->hkl;
if (pti->spDefaultImc)
{
/* IME Activation is needed */
pti->pClientInfo->CI_flags |= CI_IMMACTIVATE;
}
}
UserAssignmentLock((PVOID*)&(pti->KeyboardLayout), pKL);
pti->pClientInfo->hKL = pKL->hkl;
pti->pClientInfo->CodePage = pKL->CodePage;
}
static VOID co_IntSetKeyboardLayoutForProcess(PPROCESSINFO ppi, PKL pKL)