code: drawterm

Download patch

ref: bf3a3cdf187ea5a99386a2848a468cd2e79c3e43
parent: 07155bd7a928dbe2df7499f54f5e590d140a86b0
author: joe <devnull@localhost>
date: Thu Apr 23 08:52:37 EDT 2020

get the WM_NAME and WM_CLASS from the environment

--- a/gui-x11/x11.c
+++ b/gui-x11/x11.c
@@ -328,7 +328,8 @@
 	/*
 	 * set up property as required by ICCCM
 	 */
-	name.value = (uchar*)"drawterm";
+	if((name.value = getenv("WM_NAME")) == nil)
+		name.value = (uchar*)"drawterm";
 	name.encoding = XA_STRING;
 	name.format = 8;
 	name.nitems = strlen((char*)name.value);
@@ -341,7 +342,8 @@
 	hints.icon_pixmap = icon_pixmap;
 
 	classhints.res_name = "drawterm";
-	classhints.res_class = "Drawterm";
+	if((classhints.res_class = getenv("WM_CLASS")) == nil)
+		classhints.res_class = "Drawterm";
 	argv[0] = "drawterm";
 	argv[1] = nil;
 	XSetWMProperties(xdisplay, xdrawable,