Fix building with SDL_DISABLE_WINDOWS_IME

Regression of f317d619cc (diff-bff8f3e638d51e86cb6f0f42e2c527549d649951b7aa5ec4a539e865a5b57027R398)
This commit is contained in:
DomGries 2022-08-25 10:03:33 +02:00 committed by Sam Lantinga
parent babaa7d2bd
commit 40b2499273
1 changed files with 5 additions and 1 deletions

View File

@ -54,6 +54,7 @@ static SDL_bool IME_IsTextInputShown(SDL_VideoData* videodata);
void
WIN_InitKeyboard(_THIS)
{
#ifndef SDL_DISABLE_WINDOWS_IME
SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
data->ime_com_initialized = SDL_FALSE;
@ -101,6 +102,7 @@ WIN_InitKeyboard(_THIS)
data->ime_convmodesinkcookie = TF_INVALID_COOKIE;
data->ime_uielemsink = 0;
data->ime_ippasink = 0;
#endif /* !SDL_DISABLE_WINDOWS_IME */
WIN_UpdateKeymap(SDL_FALSE);
@ -162,12 +164,12 @@ WIN_QuitKeyboard(_THIS)
#ifndef SDL_DISABLE_WINDOWS_IME
IME_Quit(data);
#endif
if (data->ime_composition) {
SDL_free(data->ime_composition);
data->ime_composition = NULL;
}
#endif /* !SDL_DISABLE_WINDOWS_IME */
}
void
@ -252,6 +254,7 @@ WIN_SetTextInputRect(_THIS, const SDL_Rect *rect)
return;
}
#ifndef SDL_DISABLE_WINDOWS_IME
videodata->ime_rect = *rect;
himc = ImmGetContext(videodata->ime_hwnd_current);
@ -281,6 +284,7 @@ WIN_SetTextInputRect(_THIS, const SDL_Rect *rect)
ImmReleaseContext(videodata->ime_hwnd_current, himc);
}
#endif /* !SDL_DISABLE_WINDOWS_IME */
}