Skip to content

Commit e995521

Browse files
author
__
committed
Merge remote-tracking branch 'suck/master'
2 parents ac59679 + 4ef0cbd commit e995521

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

st.c

+8
Original file line numberDiff line numberDiff line change
@@ -1853,7 +1853,15 @@ strhandle(void)
18531853
case ']': /* OSC -- Operating System Command */
18541854
switch (par) {
18551855
case 0:
1856+
if (narg > 1) {
1857+
xsettitle(strescseq.args[1]);
1858+
xseticontitle(strescseq.args[1]);
1859+
}
1860+
return;
18561861
case 1:
1862+
if (narg > 1)
1863+
xseticontitle(strescseq.args[1]);
1864+
return;
18571865
case 2:
18581866
if (narg > 1)
18591867
xsettitle(strescseq.args[1]);

win.h

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ void xdrawline(Line, int, int, int);
3030
void xfinishdraw(void);
3131
void xloadcols(void);
3232
int xsetcolorname(int, const char *);
33+
void xseticontitle(char *);
3334
void xsettitle(char *);
3435
int xsetcursor(int);
3536
void xsetmode(int, unsigned int);

x.c

+15-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ typedef struct {
9393
Window win;
9494
Drawable buf;
9595
GlyphFontSpec *specbuf; /* font spec buffer used for rendering */
96-
Atom xembed, wmdeletewin, netwmname, netwmpid;
96+
Atom xembed, wmdeletewin, netwmname, netwmiconname, netwmpid;
9797
struct {
9898
XIM xim;
9999
XIC xic;
@@ -1186,6 +1186,7 @@ xinit(int cols, int rows)
11861186
xw.xembed = XInternAtom(xw.dpy, "_XEMBED", False);
11871187
xw.wmdeletewin = XInternAtom(xw.dpy, "WM_DELETE_WINDOW", False);
11881188
xw.netwmname = XInternAtom(xw.dpy, "_NET_WM_NAME", False);
1189+
xw.netwmiconname = XInternAtom(xw.dpy, "_NET_WM_ICON_NAME", False);
11891190
XSetWMProtocols(xw.dpy, xw.win, &xw.wmdeletewin, 1);
11901191

11911192
xw.netwmpid = XInternAtom(xw.dpy, "_NET_WM_PID", False);
@@ -1579,6 +1580,19 @@ xsetenv(void)
15791580
setenv("WINDOWID", buf, 1);
15801581
}
15811582

1583+
void
1584+
xseticontitle(char *p)
1585+
{
1586+
XTextProperty prop;
1587+
DEFAULT(p, opt_title);
1588+
1589+
Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle,
1590+
&prop);
1591+
XSetWMIconName(xw.dpy, xw.win, &prop);
1592+
XSetTextProperty(xw.dpy, xw.win, &prop, xw.netwmiconname);
1593+
XFree(prop.value);
1594+
}
1595+
15821596
void
15831597
xsettitle(char *p)
15841598
{

0 commit comments

Comments
 (0)