manage.c, config.h, fns.h: implement ALWAYDRAW option
This commit is contained in:
parent
a2d3fc7ffc
commit
f03abb164a
3 changed files with 20 additions and 1 deletions
1
config.h
1
config.h
|
@ -127,7 +127,6 @@
|
|||
*/
|
||||
|
||||
#define ALWAYSDRAW {\
|
||||
"cmapcube", \
|
||||
0 \
|
||||
}
|
||||
|
||||
|
|
1
fns.h
1
fns.h
|
@ -60,6 +60,7 @@ void setstate();
|
|||
void setlabel();
|
||||
void getproto();
|
||||
void gettrans();
|
||||
int shouldalwaysdraw(Client* c);
|
||||
|
||||
/* key.c */
|
||||
void keypress();
|
||||
|
|
19
manage.c
19
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
|
||||
|
|
Loading…
Reference in a new issue