Skip to content
Permalink
Browse files

Implement repositioning the OS-rendered IME with SDL_SetTextInputRect…

… on Windows.
  • Loading branch information
shakesoda committed Jun 16, 2015
1 parent 0c3830a commit ccc12a3632fe2c7e71a06a85ba73a98eedbeeb92
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/video/windows/SDL_windowskeyboard.c
@@ -187,13 +187,25 @@ void
WIN_SetTextInputRect(_THIS, SDL_Rect *rect)
{
SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata;
HIMC himc = 0;

if (!rect) {
SDL_InvalidParamError("rect");
return;
}

videodata->ime_rect = *rect;

himc = ImmGetContext(videodata->ime_hwnd_current);
if (himc)
{
COMPOSITIONFORM cf;
cf.ptCurrentPos.x = videodata->ime_rect.x;
cf.ptCurrentPos.y = videodata->ime_rect.y;
cf.dwStyle = CFS_FORCE_POSITION;
ImmSetCompositionWindow(himc, &cf);
ImmReleaseContext(videodata->ime_hwnd_current, himc);
}
}

#ifdef SDL_DISABLE_WINDOWS_IME

0 comments on commit ccc12a3

Please sign in to comment.