]> git.armaanb.net Git - st.git/blobdiff - st.c
Applying the changes to the docs; by Peter Hartman.
[st.git] / st.c
diff --git a/st.c b/st.c
index 7ceed752d31503f5da36be528dcc0167a476b8f8..701019558d21104c1467610b85619fbc9450b413 100644 (file)
--- 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[2];
 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);