diff options
author | wm4 <wm4@nowhere> | 2013-09-20 14:45:49 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-09-20 14:45:49 +0200 |
commit | 2694b5f3786575b0dde8b29b9fe162c50996c18e (patch) | |
tree | 67bccb9ceff544c6fa492cc3aa538b8cc378dae9 /video/out/x11_common.c | |
parent | 6c28524e0fb6dcbeab8bed62557669cef7996913 (diff) | |
download | mpv-2694b5f3786575b0dde8b29b9fe162c50996c18e.tar.bz2 mpv-2694b5f3786575b0dde8b29b9fe162c50996c18e.tar.xz |
vo/x11_common: don't require a working input method
Normally, we need this for Xutf8LookupString(). But we can just fall
back to XLookupString(). In fact, the code for this was already there,
the code was just never tested and was actually crashing when active
(see commit 2115c4a).
Diffstat (limited to 'video/out/x11_common.c')
-rw-r--r-- | video/out/x11_common.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c index a364b0c912..b5964ff531 100644 --- a/video/out/x11_common.c +++ b/video/out/x11_common.c @@ -479,15 +479,8 @@ int vo_x11_init(struct vo *vo) } x11->xim = XOpenIM(x11->display, NULL, NULL, NULL); - if (!x11->xim) { - MP_MSG(x11, vo->probing ? MSGL_V : MSGL_ERR, - "couldn't find a valid X input method!\n"); - - XCloseDisplay(x11->display); - talloc_free(x11); - vo->x11 = NULL; - return 0; - } + if (!x11->xim) + MP_WARN(x11, "XOpenIM() failed. Unicode input will not work.\n"); init_atoms(vo->x11); @@ -1101,11 +1094,13 @@ static void vo_x11_create_window(struct vo *vo, XVisualInfo *vis, int x, int y, x11->mouse_cursor_hidden = false; vo_set_cursor_hidden(vo, true); } - x11->xic = XCreateIC(x11->xim, - XNInputStyle, XIMPreeditNone | XIMStatusNone, - XNClientWindow, x11->window, - XNFocusWindow, x11->window, - NULL); + if (x11->xim) { + x11->xic = XCreateIC(x11->xim, + XNInputStyle, XIMPreeditNone | XIMStatusNone, + XNClientWindow, x11->window, + XNFocusWindow, x11->window, + NULL); + } vo_x11_set_wm_icon(x11); vo_x11_update_window_title(vo); |