diff --git a/config.def.h b/config.def.h index 2cd740a..91ab8ca 100644 --- a/config.def.h +++ b/config.def.h @@ -53,7 +53,7 @@ int allowwindowops = 0; * near minlatency, but it waits longer for slow updates to avoid partial draw. * low minlatency will tear/flicker more, as it can "detect" idle too early. */ -static double minlatency = 2; +static double minlatency = 8; static double maxlatency = 33; /* diff --git a/config.mk b/config.mk index fdc29a7..1e306f8 100644 --- a/config.mk +++ b/config.mk @@ -1,5 +1,5 @@ # st version -VERSION = 0.9.2 +VERSION = 0.9 # Customize below to fit your system diff --git a/st.c b/st.c index 03b9bc8..77c3e8a 100644 --- a/st.c +++ b/st.c @@ -86,8 +86,8 @@ enum escape_state { typedef struct { Glyph attr; /* current char attributes */ - int x; - int y; + int x; /* terminal column */ + int y; /* terminal row */ char state; } TCursor; @@ -1132,7 +1132,6 @@ csiparse(void) { char *p = csiescseq.buf, *np; long int v; - int sep = ';'; /* colon or semi-colon, but not both */ csiescseq.narg = 0; if (*p == '?') { @@ -1150,9 +1149,7 @@ csiparse(void) v = -1; csiescseq.arg[csiescseq.narg++] = v; p = np; - if (sep == ';' && *p == ':') - sep = ':'; /* allow override to colon once */ - if (*p != sep || csiescseq.narg == ESC_ARG_SIZ) + if (*p != ';' || csiescseq.narg == ESC_ARG_SIZ) break; p++; } @@ -1646,7 +1643,7 @@ csihandle(void) ttywrite(vtiden, strlen(vtiden), 0); break; case 'b': /* REP -- if last char is printable print it more times */ - LIMIT(csiescseq.arg[0], 1, 65535); + DEFAULT(csiescseq.arg[0], 1); if (term.lastc) while (csiescseq.arg[0]-- > 0) tputc(term.lastc); @@ -1705,7 +1702,7 @@ csihandle(void) } break; case 1: /* above */ - if (term.c.y > 0) + if (term.c.y > 1) tclearregion(0, 0, term.col-1, term.c.y-1); tclearregion(0, term.c.y, term.c.x, term.c.y); break; @@ -1801,11 +1798,7 @@ csihandle(void) tcursor(CURSOR_SAVE); break; case 'u': /* DECRC -- Restore cursor position (ANSI.SYS) */ - if (csiescseq.priv) { - goto unknown; - } else { - tcursor(CURSOR_LOAD); - } + tcursor(CURSOR_LOAD); break; case ' ': switch (csiescseq.mode[1]) { @@ -2182,12 +2175,16 @@ tstrsequence(uchar c) void tcontrolcode(uchar ascii) { + size_t i; + switch (ascii) { case '\t': /* HT */ tputtab(1); return; case '\b': /* BS */ - tmoveto(term.c.x-1, term.c.y); + for (i = 1; term.c.x && term.line[term.c.y][term.c.x - i].u == 0; ++i) + ; + tmoveto(term.c.x - i, term.c.y); return; case '\r': /* CR */ tmoveto(0, term.c.y); diff --git a/x.c b/x.c index d73152b..b36fb8c 100644 --- a/x.c +++ b/x.c @@ -1131,7 +1131,7 @@ xinit(int cols, int rows) { XGCValues gcvalues; Cursor cursor; - Window parent, root; + Window parent; pid_t thispid = getpid(); XColor xmousefg, xmousebg; @@ -1168,19 +1168,16 @@ xinit(int cols, int rows) | ButtonMotionMask | ButtonPressMask | ButtonReleaseMask; xw.attrs.colormap = xw.cmap; - root = XRootWindow(xw.dpy, xw.scr); if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0)))) - parent = root; - xw.win = XCreateWindow(xw.dpy, root, xw.l, xw.t, + parent = XRootWindow(xw.dpy, xw.scr); + xw.win = XCreateWindow(xw.dpy, parent, xw.l, xw.t, win.w, win.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput, xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity | CWEventMask | CWColormap, &xw.attrs); - if (parent != root) - XReparentWindow(xw.dpy, xw.win, parent, xw.l, xw.t); memset(&gcvalues, 0, sizeof(gcvalues)); gcvalues.graphics_exposures = False; - dc.gc = XCreateGC(xw.dpy, xw.win, GCGraphicsExposures, + dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures, &gcvalues); xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, DefaultDepth(xw.dpy, xw.scr)); @@ -1620,9 +1617,6 @@ xseticontitle(char *p) XTextProperty prop; DEFAULT(p, opt_title); - if (p[0] == '\0') - p = opt_title; - if (Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle, &prop) != Success) return; @@ -1637,9 +1631,6 @@ xsettitle(char *p) XTextProperty prop; DEFAULT(p, opt_title); - if (p[0] == '\0') - p = opt_title; - if (Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle, &prop) != Success) return;