diff --git a/meson.build b/meson.build index ad6f9dde08..3a5bcaed65 100644 --- a/meson.build +++ b/meson.build @@ -489,6 +489,7 @@ if features['win32-desktop'] win32_desktop_libs = [cc.find_library('avrt'), cc.find_library('dwmapi'), cc.find_library('gdi32'), + cc.find_library('imm32'), cc.find_library('ole32'), cc.find_library('uuid'), cc.find_library('uxtheme'), diff --git a/test/meson.build b/test/meson.build index ebd4395c71..32796fad34 100644 --- a/test/meson.build +++ b/test/meson.build @@ -50,6 +50,7 @@ if not features['win32-threads'] endif if features['win32-desktop'] + test_utils_deps += cc.find_library('imm32') test_utils_deps += cc.find_library('winmm') endif test_utils_objects = libmpv.extract_objects(test_utils_files) diff --git a/video/out/w32_common.c b/video/out/w32_common.c index 717430bb1f..d2972f9193 100644 --- a/video/out/w32_common.c +++ b/video/out/w32_common.c @@ -1551,6 +1551,15 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, ((LPNCCALCSIZE_PARAMS) lParam)->rgrc[0].top -= get_title_bar_height(w32); } break; + case WM_IME_STARTCOMPOSITION: { + HIMC imc = ImmGetContext(w32->window); + if (imc) { + COMPOSITIONFORM cf = {.dwStyle = CFS_POINT, .ptCurrentPos = {0, 0}}; + ImmSetCompositionWindow(imc, &cf); + ImmReleaseContext(w32->window, imc); + } + break; + } } if (message == w32->tbtn_created_msg) {