mirror of https://github.com/mpv-player/mpv
4ab1ab8284
The implementation is minimal since it already uses XIM for UTF-8 text input. The only changes needed are small fixes: setting the IC focus and correct the usage of window param for XFilterEvent, and IME will "just work"... ...after setting 2 process-wide global values before VO creation: LC_CTYPE and X locale modifiers. So this usage is currently limited to libmpv clients which don't want to do their own IME processing. locale strikes once again: XIM input methods require them to be set before creating the XIM context to work, even though they don't matter after the context is created. Both of these values being process-wide global means that the only time to safely set these values is before the process creates any thread. In theory, mpv could set LC_CTYPE in the main when running standalone, but locale being locale means something is always messed up. In this case, setting LC_CTYPE changes "Character classification and case conversion" behavior. While mpv uses its own ASCII-only is*() and to*() functions to avoid some of the issues, it also uses strcasecmp() and POSIX regex which behaviors are affected by LC_CTYPE. In summary, to avoid unavoidable race conditions mpv won't do this in standalone mode right now. It's now libmpv users' responsibility to: - set LC_CTYPE to a locale usable for XIM, such as a UTF-8 locale - set X locale modifiers with XSetLocaleModifiers - hope that all stars align if trying to switch locale back afterwards On most setups, both of these can be empty strings, In this case, the usual XMODIFIERS environment variable must be set to enable IME support. (e.g. XMODIFIERS=@im=fcitx) |
||
---|---|---|
.. | ||
d3d11 | ||
gpu | ||
gpu_next | ||
hwdec | ||
mac | ||
opengl | ||
placebo | ||
vulkan | ||
win32 | ||
wldmabuf | ||
android_common.c | ||
android_common.h | ||
aspect.c | ||
aspect.h | ||
bitmap_packer.c | ||
bitmap_packer.h | ||
cocoa_cb_common.swift | ||
dither.c | ||
dither.h | ||
dr_helper.c | ||
dr_helper.h | ||
drm_atomic.c | ||
drm_atomic.h | ||
drm_common.c | ||
drm_common.h | ||
drm_prime.c | ||
drm_prime.h | ||
filter_kernels.c | ||
filter_kernels.h | ||
libmpv.h | ||
libmpv_sw.c | ||
mac_common.swift | ||
meson.build | ||
present_sync.c | ||
present_sync.h | ||
vo.c | ||
vo.h | ||
vo_caca.c | ||
vo_direct3d.c | ||
vo_dmabuf_wayland.c | ||
vo_drm.c | ||
vo_gpu.c | ||
vo_gpu_next.c | ||
vo_image.c | ||
vo_kitty.c | ||
vo_lavc.c | ||
vo_libmpv.c | ||
vo_mediacodec_embed.c | ||
vo_null.c | ||
vo_sdl.c | ||
vo_sixel.c | ||
vo_tct.c | ||
vo_vaapi.c | ||
vo_vdpau.c | ||
vo_wlshm.c | ||
vo_x11.c | ||
vo_xv.c | ||
w32_common.c | ||
w32_common.h | ||
wayland_common.c | ||
wayland_common.h | ||
win_state.c | ||
win_state.h | ||
x11_common.c | ||
x11_common.h |