update to 0.8.5 (apply patch st-csi_22_23-0.8.5.diff)
This commit is contained in:
36
st.c
36
st.c
@@ -1928,6 +1928,33 @@ csihandle(void)
|
||||
goto unknown;
|
||||
}
|
||||
break;
|
||||
case 't': /* title stack operations */
|
||||
switch (csiescseq.arg[0]) {
|
||||
case 22: /* pust current title on stack */
|
||||
switch (csiescseq.arg[1]) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
xpushtitle();
|
||||
break;
|
||||
default:
|
||||
goto unknown;
|
||||
}
|
||||
break;
|
||||
case 23: /* pop last title from stack */
|
||||
switch (csiescseq.arg[1]) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
xsettitle(NULL, 1);
|
||||
break;
|
||||
default:
|
||||
goto unknown;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
goto unknown;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2006,7 +2033,7 @@ strhandle(void)
|
||||
switch (par) {
|
||||
case 0:
|
||||
if (narg > 1) {
|
||||
xsettitle(strescseq.args[1]);
|
||||
xsettitle(strescseq.args[1], 0);
|
||||
xseticontitle(strescseq.args[1]);
|
||||
}
|
||||
return;
|
||||
@@ -2016,7 +2043,7 @@ strhandle(void)
|
||||
return;
|
||||
case 2:
|
||||
if (narg > 1)
|
||||
xsettitle(strescseq.args[1]);
|
||||
xsettitle(strescseq.args[1], 0);
|
||||
return;
|
||||
case 52: /* manipulate selection data */
|
||||
if (narg > 2 && allowwindowops) {
|
||||
@@ -2088,7 +2115,7 @@ strhandle(void)
|
||||
}
|
||||
break;
|
||||
case 'k': /* old title set compatibility */
|
||||
xsettitle(strescseq.args[0]);
|
||||
xsettitle(strescseq.args[0], 0);
|
||||
return;
|
||||
case 'P': /* DCS -- Device Control String */
|
||||
case '_': /* APC -- Application Program Command */
|
||||
@@ -2565,6 +2592,7 @@ eschandle(uchar ascii)
|
||||
break;
|
||||
case 'c': /* RIS -- Reset to initial state */
|
||||
treset();
|
||||
xfreetitlestack();
|
||||
resettitle();
|
||||
xloadcols();
|
||||
xsetmode(0, MODE_HIDE);
|
||||
@@ -2867,7 +2895,7 @@ tresize(int col, int row)
|
||||
void
|
||||
resettitle(void)
|
||||
{
|
||||
xsettitle(NULL);
|
||||
xsettitle(NULL, 0);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
4
st.info
4
st.info
@@ -161,7 +161,7 @@ st-mono| simpleterm monocolor,
|
||||
rin=\E[%p1%dT,
|
||||
ritm=\E[23m,
|
||||
rmacs=\E(B,
|
||||
rmcup=\E[?1049l,
|
||||
rmcup=\E[?1049l\E[23;0;0t,
|
||||
rmir=\E[4l,
|
||||
rmkx=\E[?1l\E>,
|
||||
rmso=\E[27m,
|
||||
@@ -172,7 +172,7 @@ st-mono| simpleterm monocolor,
|
||||
sitm=\E[3m,
|
||||
sgr0=\E[0m,
|
||||
smacs=\E(0,
|
||||
smcup=\E[?1049h,
|
||||
smcup=\E[?1049h\E[22;0;0t,
|
||||
smir=\E[4h,
|
||||
smkx=\E[?1h\E=,
|
||||
smso=\E[7m,
|
||||
|
||||
4
win.h
4
win.h
@@ -33,7 +33,9 @@ void xloadcols(void);
|
||||
int xsetcolorname(int, const char *);
|
||||
int xgetcolor(int, unsigned char *, unsigned char *, unsigned char *);
|
||||
void xseticontitle(char *);
|
||||
void xsettitle(char *);
|
||||
void xfreetitlestack(void);
|
||||
void xsettitle(char *, int);
|
||||
void xpushtitle(void);
|
||||
int xsetcursor(int);
|
||||
void xsetmode(int, unsigned int);
|
||||
void xsetpointermotion(int);
|
||||
|
||||
39
x.c
39
x.c
@@ -75,6 +75,9 @@ char **externalpastecmd()
|
||||
return (lightmode) ? externalpastelightcmd : externalpastedarkcmd;
|
||||
}
|
||||
|
||||
/* size of title stack */
|
||||
#define TITLESTACKSIZE 8
|
||||
|
||||
/* XEMBED messages */
|
||||
#define XEMBED_FOCUS_IN 4
|
||||
#define XEMBED_FOCUS_OUT 5
|
||||
@@ -233,6 +236,8 @@ static DC dc;
|
||||
static XWindow xw;
|
||||
static XSelection xsel;
|
||||
static TermWindow win;
|
||||
static int tstki; /* title stack index */
|
||||
static char *titlestack[TITLESTACKSIZE]; /* title stack */
|
||||
|
||||
/* Font Ring Cache */
|
||||
enum {
|
||||
@@ -1674,10 +1679,30 @@ xseticontitle(char *p)
|
||||
}
|
||||
|
||||
void
|
||||
xsettitle(char *p)
|
||||
xfreetitlestack(void)
|
||||
{
|
||||
for (int i = 0; i < LEN(titlestack); i++) {
|
||||
free(titlestack[i]);
|
||||
titlestack[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
xsettitle(char *p, int pop)
|
||||
{
|
||||
XTextProperty prop;
|
||||
DEFAULT(p, opt_title);
|
||||
|
||||
free(titlestack[tstki]);
|
||||
if (pop) {
|
||||
titlestack[tstki] = NULL;
|
||||
tstki = (tstki - 1 + TITLESTACKSIZE) % TITLESTACKSIZE;
|
||||
p = titlestack[tstki] ? titlestack[tstki] : opt_title;
|
||||
} else if (p) {
|
||||
titlestack[tstki] = xstrdup(p);
|
||||
} else {
|
||||
titlestack[tstki] = NULL;
|
||||
p = opt_title;
|
||||
}
|
||||
|
||||
if (p[0] == '\0')
|
||||
p = opt_title;
|
||||
@@ -1690,6 +1715,16 @@ xsettitle(char *p)
|
||||
XFree(prop.value);
|
||||
}
|
||||
|
||||
void
|
||||
xpushtitle(void)
|
||||
{
|
||||
int tstkin = (tstki + 1) % TITLESTACKSIZE;
|
||||
|
||||
free(titlestack[tstkin]);
|
||||
titlestack[tstkin] = titlestack[tstki] ? xstrdup(titlestack[tstki]) : NULL;
|
||||
tstki = tstkin;
|
||||
}
|
||||
|
||||
int
|
||||
xstartdraw(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user