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