From 5cc810e7f84256bb606bc8fe0514238af98bc191 Mon Sep 17 00:00:00 2001 From: nanahi <130121847+na-na-hi@users.noreply.github.com> Date: Sun, 10 Dec 2023 01:31:12 -0500 Subject: [PATCH] x11_common: fix compose key handling Compose key doesn't function in X11 because XFilterEvent() isn't called, and XNInputStyle is set to a wrong value. This results in KeyPress events for the separate keyboard inputs in the compose key input sequence instead of the composed character, making it impossible to input certain characters which require compose key. Fix this by calling the required XFilterEvent() and set XNInputStyle to the correct value. --- video/out/x11_common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/video/out/x11_common.c b/video/out/x11_common.c index d006445cdb..bae2918157 100644 --- a/video/out/x11_common.c +++ b/video/out/x11_common.c @@ -1177,6 +1177,8 @@ void vo_x11_check_events(struct vo *vo) while (XPending(display)) { XNextEvent(display, &Event); + if (XFilterEvent(&Event, x11->window)) + continue; MP_TRACE(x11, "XEvent: %d\n", Event.type); switch (Event.type) { case Expose: @@ -1579,7 +1581,7 @@ static void vo_x11_create_window(struct vo *vo, XVisualInfo *vis, if (x11->xim) { x11->xic = XCreateIC(x11->xim, - XNInputStyle, XIMPreeditNone | XIMStatusNone, + XNInputStyle, XIMPreeditNothing | XIMStatusNothing, XNClientWindow, x11->window, XNFocusWindow, x11->window, NULL);