Win32 IME: Rename SetInputLanguage()

GHOST_ImeWin32::SetInputLanguage() has a confusing name because it does
not set the input language. It actually retrieves the current input
locale from the OS and caches the value of the current input language
ID. Therefore this patch renames it to "UpdateInputLanguage"

Differential Revision: https://developer.blender.org/D12134

Reviewed by Ray Molenkamp
This commit is contained in:
Harley Acheson 2021-08-04 14:30:16 -07:00
parent 1d1020b79f
commit 07b702f828
3 changed files with 8 additions and 8 deletions

View File

@ -46,13 +46,13 @@ GHOST_ImeWin32::~GHOST_ImeWin32()
{
}
void GHOST_ImeWin32::SetInputLanguage()
void GHOST_ImeWin32::UpdateInputLanguage()
{
/**
* Retrieve the current input language.
* Store the current input language.
*/
HKL keyboard_layout = ::GetKeyboardLayout(0);
input_language_id_ = LOWORD(keyboard_layout);
HKL input_locale = ::GetKeyboardLayout(0);
input_language_id_ = LOWORD(input_locale);
}
WORD GHOST_ImeWin32::GetInputLanguage()

View File

@ -88,7 +88,7 @@ class GHOST_EventIME : public GHOST_Event {
* An application CAN call ::DefWindowProc().
* 2.5. WM_INPUTLANGCHANGE (0x0051)
* Call the functions listed below:
* - GHOST_ImeWin32::SetInputLanguage().
* - GHOST_ImeWin32::UpdateInputLanguage().
* An application CAN call ::DefWindowProc().
*/
@ -149,7 +149,7 @@ class GHOST_ImeWin32 {
/**
* Retrieves the input language from Windows and update it.
*/
void SetInputLanguage();
void UpdateInputLanguage();
/* Returns the current input language id. */
WORD GetInputLanguage();

View File

@ -1424,7 +1424,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
case WM_INPUTLANGCHANGE: {
system->handleKeyboardChange();
#ifdef WITH_INPUT_IME
window->getImeInput()->SetInputLanguage();
window->getImeInput()->UpdateInputLanguage();
window->getImeInput()->UpdateConversionStatus(hwnd);
#endif
break;
@ -1471,7 +1471,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
}
case WM_IME_SETCONTEXT: {
GHOST_ImeWin32 *ime = window->getImeInput();
ime->SetInputLanguage();
ime->UpdateInputLanguage();
ime->CreateImeWindow(hwnd);
ime->CleanupComposition(hwnd);
ime->CheckFirst(hwnd);