X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=st.c;h=6f5ca8036ee39bfdeaae466bc3e9d7c84f219df9;hb=b233007e0fddbb5ad8da3e436533254d099c8861;hp=7ceed752d31503f5da36be528dcc0167a476b8f8;hpb=c99db5b0170555c5bb0359ac8a8229cdada64b30;p=st.git diff --git a/st.c b/st.c index 7ceed75..6f5ca80 100644 --- a/st.c +++ b/st.c @@ -436,7 +436,7 @@ typedef struct { * the current length of used elements. */ -static Fontcache frc[2048]; +static Fontcache frc[1024]; static int frccur = -1, frclen = 0; ssize_t @@ -2503,9 +2503,17 @@ xinit(void) { xw.draw = XftDrawCreate(xw.dpy, xw.buf, xw.vis, xw.cmap); /* input methods */ - xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL); - if(xw.xim == NULL) - die("XOpenIM failed. Could not open input device.\n"); + if((xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL)) == NULL) { + XSetLocaleModifiers("@im=local"); + if((xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL)) == NULL) { + XSetLocaleModifiers("@im="); + if((xw.xim = XOpenIM(xw.dpy, + NULL, NULL, NULL)) == NULL) { + die("XOpenIM failed. Could not open input" + " device.\n"); + } + } + } xw.xic = XCreateIC(xw.xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing, XNClientWindow, xw.win, XNFocusWindow, xw.win, NULL);