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) |
||
---|---|---|
.. | ||
decode | ||
filter | ||
out | ||
csputils.c | ||
csputils.h | ||
cuda.c | ||
d3d.c | ||
d3d.h | ||
drmprime.c | ||
fmt-conversion.c | ||
fmt-conversion.h | ||
hwdec.c | ||
hwdec.h | ||
image_loader.c | ||
image_loader.h | ||
image_writer.c | ||
image_writer.h | ||
img_format.c | ||
img_format.h | ||
mp_image.c | ||
mp_image.h | ||
mp_image_pool.c | ||
mp_image_pool.h | ||
repack.c | ||
repack.h | ||
sws_utils.c | ||
sws_utils.h | ||
vaapi.c | ||
vaapi.h | ||
vdpau.c | ||
vdpau.h | ||
vdpau_functions.inc | ||
vdpau_mixer.c | ||
vdpau_mixer.h | ||
zimg.c | ||
zimg.h |