change compileregs proto, simplify
This commit is contained in:
parent
fc686750eb
commit
1ad4adf901
|
@ -165,7 +165,7 @@ setup(Display *disp, awesome_config *awesomeconf)
|
||||||
XChangeWindowAttributes(disp, DefaultRootWindow(disp), CWEventMask | CWCursor, &wa);
|
XChangeWindowAttributes(disp, DefaultRootWindow(disp), CWEventMask | CWCursor, &wa);
|
||||||
XSelectInput(disp, DefaultRootWindow(disp), wa.event_mask);
|
XSelectInput(disp, DefaultRootWindow(disp), wa.event_mask);
|
||||||
grabkeys(disp, awesomeconf);
|
grabkeys(disp, awesomeconf);
|
||||||
compileregs(awesomeconf);
|
compileregs(awesomeconf->rules, awesomeconf->nrules);
|
||||||
/* bar */
|
/* bar */
|
||||||
dc.h = awesomeconf->statusbar.height = dc.font.height + 2;
|
dc.h = awesomeconf->statusbar.height = dc.font.height + 2;
|
||||||
wa.override_redirect = 1;
|
wa.override_redirect = 1;
|
||||||
|
|
14
tag.c
14
tag.c
|
@ -75,28 +75,28 @@ applyrules(Client * c, awesome_config *awesomeconf)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
compileregs(awesome_config * awesomeconf)
|
compileregs(Rule * rules, int nrules)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
regex_t *reg;
|
regex_t *reg;
|
||||||
|
|
||||||
if(regs)
|
if(regs)
|
||||||
return;
|
return;
|
||||||
regs = p_new(Regs, awesomeconf->nrules);
|
regs = p_new(Regs, nrules);
|
||||||
for(i = 0; i < awesomeconf->nrules; i++)
|
for(i = 0; i < nrules; i++)
|
||||||
{
|
{
|
||||||
if(awesomeconf->rules[i].prop)
|
if(rules[i].prop)
|
||||||
{
|
{
|
||||||
reg = p_new(regex_t, 1);
|
reg = p_new(regex_t, 1);
|
||||||
if(regcomp(reg, awesomeconf->rules[i].prop, REG_EXTENDED))
|
if(regcomp(reg, rules[i].prop, REG_EXTENDED))
|
||||||
p_delete(®);
|
p_delete(®);
|
||||||
else
|
else
|
||||||
regs[i].propregex = reg;
|
regs[i].propregex = reg;
|
||||||
}
|
}
|
||||||
if(awesomeconf->rules[i].tags)
|
if(rules[i].tags)
|
||||||
{
|
{
|
||||||
reg = p_new(regex_t, 1);
|
reg = p_new(regex_t, 1);
|
||||||
if(regcomp(reg, awesomeconf->rules[i].tags, REG_EXTENDED))
|
if(regcomp(reg, rules[i].tags, REG_EXTENDED))
|
||||||
p_delete(®);
|
p_delete(®);
|
||||||
else
|
else
|
||||||
regs[i].tagregex = reg;
|
regs[i].tagregex = reg;
|
||||||
|
|
2
tag.h
2
tag.h
|
@ -9,7 +9,7 @@
|
||||||
/** Check if a client is tiled */
|
/** Check if a client is tiled */
|
||||||
#define IS_TILED(client, tags, ntags) (client && !client->isfloating && isvisible(client, tags, ntags))
|
#define IS_TILED(client, tags, ntags) (client && !client->isfloating && isvisible(client, tags, ntags))
|
||||||
|
|
||||||
void compileregs(awesome_config *); /* initialize regexps of rules defined in config.h */
|
void compileregs(Rule *, int); /* initialize regexps of rules defined in config.h */
|
||||||
Bool isvisible(Client *, Bool *, int);
|
Bool isvisible(Client *, Bool *, int);
|
||||||
void applyrules(Client * c, awesome_config *); /* applies rules to c */
|
void applyrules(Client * c, awesome_config *); /* applies rules to c */
|
||||||
void uicb_tag(Display *, awesome_config *, const char *); /* tags sel with arg's index */
|
void uicb_tag(Display *, awesome_config *, const char *); /* tags sel with arg's index */
|
||||||
|
|
Loading…
Reference in New Issue