update to 0.8.5 (apply patch st-csi_22_23-0.8.5.diff)

This commit is contained in:
wael
2022-04-11 21:28:43 +03:00
committed by Łukasz Pankowski
parent 01873515e4
commit f37ea1f018
4 changed files with 74 additions and 9 deletions

39
x.c
View File

@@ -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)
{