]client,x11] fix unicode lookup

This commit is contained in:
akallabeth
2025-03-22 20:33:12 +01:00
parent 17bcb04c9b
commit d41c2b3dc8

View File

@@ -675,15 +675,30 @@ void xf_keyboard_send_key(xfContext* xfc, BOOL down, BOOL repeat, const XKeyEven
default:
{
XIM xim = XOpenIM(xfc->display, 0, 0, 0);
XIC xic =
XCreateIC(xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing, NULL);
KeySym ignore = { 0 };
Status return_status = 0;
XKeyEvent ev = *event;
ev.type = KeyPress;
xwc = XwcLookupString(xic, &ev, buffer, ARRAYSIZE(buffer), &ignore,
&return_status);
if (!xim)
{
WLog_WARN(TAG, "Failed to XOpenIM");
}
else
{
XIC xic = XCreateIC(xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
NULL);
if (!xic)
{
WLog_WARN(TAG, "XCreateIC failed");
}
else
{
KeySym ignore = { 0 };
Status return_status = 0;
XKeyEvent ev = *event;
ev.type = KeyPress;
xwc = XwcLookupString(xic, &ev, buffer, ARRAYSIZE(buffer), &ignore,
&return_status);
XDestroyIC(xic);
}
XCloseIM(xim);
}
}
break;
}