X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=st.c;h=6f5ca8036ee39bfdeaae466bc3e9d7c84f219df9;hb=73879c172943928542225cdc975b3b7e2449ddc0;hp=6baa086700990bb33dacb3086ca7a8a8e98356be;hpb=44e1b79abfe81d5d9d1b4845a68533e84b37e2f0;p=st.git diff --git a/st.c b/st.c index 6baa086..6f5ca80 100644 --- a/st.c +++ b/st.c @@ -436,7 +436,7 @@ typedef struct { * the current length of used elements. */ -static Fontcache frc[256]; +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);