aboutsummaryrefslogtreecommitdiff
path: root/x.c
diff options
context:
space:
mode:
authorJohn Collis <john.collis@alliedtelesis.co.nz>2020-09-06 17:53:41 +1200
committerHiltjo Posthuma <hiltjo@codemadness.org>2020-10-18 11:17:11 +0200
commit28b4c822c5c0acec300fdf15c6e3ede9f5e2335d (patch)
treeb2af1c27a64169cfd7a8807c207d07a6c429bd6c /x.c
parentfa253f077f19b3220c7655b81bd91e52f4367803 (diff)
downloadst-28b4c822c5c0acec300fdf15c6e3ede9f5e2335d.tar.gz
st-28b4c822c5c0acec300fdf15c6e3ede9f5e2335d.tar.bz2
st-28b4c822c5c0acec300fdf15c6e3ede9f5e2335d.zip
ST: Add WM_ICON_NAME property support
Also added _NET_WM_ICON_NAME.
Diffstat (limited to 'x.c')
-rw-r--r--x.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/x.c b/x.c
index 210f184..120e495 100644
--- a/x.c
+++ b/x.c
@@ -93,7 +93,7 @@ typedef struct {
Window win;
Drawable buf;
GlyphFontSpec *specbuf; /* font spec buffer used for rendering */
- Atom xembed, wmdeletewin, netwmname, netwmpid;
+ Atom xembed, wmdeletewin, netwmname, netwmiconname, netwmpid;
struct {
XIM xim;
XIC xic;
@@ -1186,6 +1186,7 @@ xinit(int cols, int rows)
xw.xembed = XInternAtom(xw.dpy, "_XEMBED", False);
xw.wmdeletewin = XInternAtom(xw.dpy, "WM_DELETE_WINDOW", False);
xw.netwmname = XInternAtom(xw.dpy, "_NET_WM_NAME", False);
+ xw.netwmiconname = XInternAtom(xw.dpy, "_NET_WM_ICON_NAME", False);
XSetWMProtocols(xw.dpy, xw.win, &xw.wmdeletewin, 1);
xw.netwmpid = XInternAtom(xw.dpy, "_NET_WM_PID", False);
@@ -1580,6 +1581,19 @@ xsetenv(void)
}
void
+xseticontitle(char *p)
+{
+ XTextProperty prop;
+ DEFAULT(p, opt_title);
+
+ Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle,
+ &prop);
+ XSetWMIconName(xw.dpy, xw.win, &prop);
+ XSetTextProperty(xw.dpy, xw.win, &prop, xw.netwmiconname);
+ XFree(prop.value);
+}
+
+void
xsettitle(char *p)
{
XTextProperty prop;