mirror of
git://git.suckless.org/st
synced 2025-04-19 19:34:47 +01:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
98610fcd37 | ||
|
6009e6e25b | ||
|
a0274bc20e | ||
|
5dbcca4926 |
11
st.c
11
st.c
@ -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++;
|
||||||
}
|
}
|
||||||
@ -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) */
|
||||||
|
if (csiescseq.priv) {
|
||||||
|
goto unknown;
|
||||||
|
} else {
|
||||||
tcursor(CURSOR_LOAD);
|
tcursor(CURSOR_LOAD);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case ' ':
|
case ' ':
|
||||||
switch (csiescseq.mode[1]) {
|
switch (csiescseq.mode[1]) {
|
||||||
|
11
x.c
11
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));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user