aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Stevens <nilix@nilfm.cc>2021-03-10 22:03:49 -0500
committerDerek Stevens <nilix@nilfm.cc>2021-03-10 22:03:49 -0500
commitf03abb164ad317dec9ed6898ec757b7991aac6a0 (patch)
tree257d41d19968a2768508c50a913b1f332f555490
parenta2d3fc7ffc3d7c9a329628d05e04d9cea9dfda72 (diff)
manage.c, config.h, fns.h: implement ALWAYDRAW option
-rw-r--r--config.h1
-rw-r--r--fns.h1
-rw-r--r--manage.c19
3 files changed, 20 insertions, 1 deletions
diff --git a/config.h b/config.h
index 51ae1a9..e1a38e4 100644
--- a/config.h
+++ b/config.h
@@ -127,7 +127,6 @@
*/
#define ALWAYSDRAW {\
- "cmapcube", \
0 \
}
diff --git a/fns.h b/fns.h
index cced2bf..7e88fa1 100644
--- a/fns.h
+++ b/fns.h
@@ -60,6 +60,7 @@ void setstate();
void setlabel();
void getproto();
void gettrans();
+int shouldalwaysdraw(Client* c);
/* key.c */
void keypress();
diff --git a/manage.c b/manage.c
index 8ae4f16..1e2fa8d 100644
--- a/manage.c
+++ b/manage.c
@@ -44,7 +44,11 @@ int manage(Client* c, int mapped) {
if (XGetClassHint(dpy, c->window, &class) != 0) { /* ``Success'' */
c->instance = class.res_name;
c->class = class.res_class;
+#ifdef ALWAYSDRAW
+ c->is9term = shouldalwaysdraw(c);
+#else
c->is9term = 0;
+#endif
if (isNew) {
c->is9term = strstr(c->class, "term") || strstr(c->class, "Term") ||
strstr(c->class, "urxvt") || strstr(c->class, "URxvt") ||
@@ -554,3 +558,18 @@ void getproto(Client* c) {
XFree((char*)p);
}
+
+#ifdef ALWAYSDRAW
+int shouldalwaysdraw(Client* c) {
+ static char* alwaysdraw[] = ALWAYSDRAW;
+ char** a = alwaysdraw;
+
+ while (*a) {
+ if (c && c->class && strstr(c->class, *a)) {
+ return 1;
+ }
+ ++a;
+ }
+ return 0;
+}
+#endif