mirror of https://github.com/mpv-player/mpv
win32: move IME candidate window to video window
By default the IME candidate window appears on the top left corner of the monitor. Move it to the video window for sane behavior.
This commit is contained in:
parent
2b1024fa50
commit
7ffd947830
|
@ -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'),
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue