mirror of https://github.com/0intro/wmii
enabled /def/rules handling, added default /def/rules to wmiirc
This commit is contained in:
parent
321ba8b56a
commit
9ce2bd40c4
|
@ -39,13 +39,9 @@ alloc_client(Window w, XWindowAttributes *wa)
|
|||
free(name.value);
|
||||
}
|
||||
if(XGetClassHint(dpy, c->win, &ch)) {
|
||||
ch.res_class = ch.res_name = nil;
|
||||
snprintf(c->classinst, sizeof(c->classinst), "%s:%s",
|
||||
ch.res_class ? ch.res_class : "", ch.res_name ? ch.res_name : "");
|
||||
if(ch.res_class)
|
||||
XFree(ch.res_class);
|
||||
if(ch.res_name)
|
||||
XFree(ch.res_name);
|
||||
snprintf(c->classinst, sizeof(c->classinst), "%s:%s", ch.res_class, ch.res_name);
|
||||
XFree(ch.res_class);
|
||||
XFree(ch.res_name);
|
||||
}
|
||||
fwa.override_redirect = 1;
|
||||
fwa.background_pixmap = ParentRelative;
|
||||
|
@ -317,15 +313,11 @@ manage_client(Client *c)
|
|||
{
|
||||
Tag *t;
|
||||
|
||||
if(c->trans) {
|
||||
c->tags[0] = '~';
|
||||
c->tags[1] = 0;
|
||||
}
|
||||
else
|
||||
c->tags[0] = 0;
|
||||
match_tags(c);
|
||||
|
||||
t = ntag ? tag[sel] : alloc_tag(def.tag);
|
||||
cext_strlcat(c->tags, t->name, sizeof(c->tags));
|
||||
if(!c->tags[0])
|
||||
cext_strlcpy(c->tags, t->name, sizeof(c->tags));
|
||||
|
||||
update_tags();
|
||||
|
||||
|
|
|
@ -108,17 +108,19 @@ match(Rule *rule, unsigned int nrule, char *prop)
|
|||
}
|
||||
|
||||
void
|
||||
match_tags(char *ruledef, Client *c)
|
||||
match_tags(Client *c)
|
||||
{
|
||||
unsigned int n;
|
||||
Rule *rules = parse(ruledef, &n);
|
||||
Rule *rules = parse(def.rules, &n);
|
||||
char *tags;
|
||||
|
||||
c->tags[0] = 0;
|
||||
tags = match(rules, n, c->name);
|
||||
fprintf(stderr, "match_tags tags=%s c->name=%s\n", tags, c->name);
|
||||
if(strlen(tags))
|
||||
cext_strlcat(c->tags, tags, sizeof(c->tags));
|
||||
tags = match(rules, n, c->classinst);
|
||||
fprintf(stderr, "match_tags tags=%s c->name=%s\n", tags, c->name);
|
||||
if(strlen(tags))
|
||||
cext_strlcat(c->tags, tags, sizeof(c->tags));
|
||||
|
||||
|
|
|
@ -288,7 +288,7 @@ attach_totag(Tag *t, Client *c)
|
|||
{
|
||||
Area *a;
|
||||
|
||||
if(strchr(c->tags, '~'))
|
||||
if(c->trans || strchr(c->tags, '~'))
|
||||
a = t->area[0];
|
||||
else
|
||||
a = t->area[t->sel];
|
||||
|
|
|
@ -286,7 +286,7 @@ void grab_mouse(Window w, unsigned long mod, unsigned int button);
|
|||
void ungrab_mouse(Window w, unsigned long mod, unsigned int button);
|
||||
|
||||
/* rule.c */
|
||||
void match_tags(char *ruledef, Client *c);
|
||||
void match_tags(Client *c);
|
||||
|
||||
/* tag.c */
|
||||
Tag *alloc_tag(char *name);
|
||||
|
|
Loading…
Reference in New Issue