JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Adding a nasty resize bug. Maybe it can be fixed.
[st.git] / st.c
diff --git a/st.c b/st.c
index 6dcf0c7..213541f 100644 (file)
--- 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
@@ -1390,7 +1390,7 @@ tsetattr(int *attr, int l) {
                case 1:
                        term.c.attr.mode |= ATTR_BOLD;
                        break;
-               case 3: /* enter standout (highlight) */
+               case 3:
                        term.c.attr.mode |= ATTR_ITALIC;
                        break;
                case 4:
@@ -1406,7 +1406,7 @@ tsetattr(int *attr, int l) {
                case 22:
                        term.c.attr.mode &= ~ATTR_BOLD;
                        break;
-               case 23: /* leave standout (highlight) mode */
+               case 23:
                        term.c.attr.mode &= ~ATTR_ITALIC;
                        break;
                case 24:
@@ -2497,15 +2497,23 @@ xinit(void) {
        /* double buffering */
        if(!XdbeQueryExtension(xw.dpy, &major, &minor))
                die("Xdbe extension is not present\n");
-       xw.buf = XdbeAllocateBackBufferName(xw.dpy, xw.win, XdbeCopied);
+       xw.buf = XdbeAllocateBackBufferName(xw.dpy, xw.win, XdbeBackground);
 
        /* Xft rendering context */
        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);
@@ -2542,7 +2550,6 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
        FcPattern *fcpattern, *fontpattern;
        FcFontSet *fcsets[] = { NULL };
        FcCharSet *fccharset;
-       XGlyphInfo extents;
        Colour *fg = &dc.col[base.fg], *bg = &dc.col[base.bg],
                 *temp, revfg, revbg;
        XRenderColor colfg, colbg;