termux-packages/x11-packages/dmenu/dmenu.c-check-for-locale-support.patch
2022-04-25 23:04:42 +09:00

44 lines
940 B
Diff

--- a/dmenu.c
+++ b/dmenu.c
@@ -312,6 +312,11 @@
KeySym ksym;
Status status;
+#ifdef __ANDROID__
+ if (!XSupportsLocale()) {
+ len = XLookupString(ev, buf, sizeof buf, &ksym, NULL);
+ } else {
+#endif
len = XmbLookupString(xic, ev, buf, sizeof buf, &ksym, &status);
switch (status) {
default: /* XLookupNone, XBufferOverflow */
@@ -322,6 +327,9 @@
case XLookupBoth:
break;
}
+#ifdef __ANDROID__
+ }
+#endif
if (ev->state & ControlMask) {
switch(ksym) {
@@ -665,12 +673,18 @@
XSetClassHint(dpy, win, &ch);
+#ifdef __ANDROID__
+ if (XSupportsLocale()) {
+#endif
/* input methods */
if ((xim = XOpenIM(dpy, NULL, NULL, NULL)) == NULL)
die("XOpenIM failed: could not open input device");
xic = XCreateIC(xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
XNClientWindow, win, XNFocusWindow, win, NULL);
+#ifdef __ANDROID__
+ }
+#endif
XMapRaised(dpy, win);
if (embed) {