fix rules handling in configurequest events
This commit is contained in:
parent
963bef908e
commit
355dc7d556
62
client.c
62
client.c
|
@ -287,34 +287,7 @@ client_manage(Window w, XWindowAttributes *wa, awesome_config *awesomeconf)
|
|||
|
||||
/* loadprops or apply rules if no props */
|
||||
if(!loadprops(c, awesomeconf->ntags))
|
||||
{
|
||||
Rule *r;
|
||||
Bool matched = False;
|
||||
for(r = current_acf->rules; r; r = r->next)
|
||||
if(client_match_rule(c, r))
|
||||
{
|
||||
c->isfloating = r->isfloating;
|
||||
|
||||
if(r->screen != RULE_NOSCREEN && r->screen != c->screen)
|
||||
{
|
||||
current_acf = &awesomeconf[r->screen - awesomeconf->screen];
|
||||
move_client_to_screen(c, current_acf, True);
|
||||
}
|
||||
|
||||
for(i = 0; i < current_acf->ntags; i++)
|
||||
if(is_tag_match_rules(¤t_acf->tags[i], r))
|
||||
{
|
||||
matched = True;
|
||||
c->tags[i] = True;
|
||||
}
|
||||
else
|
||||
c->tags[i] = False;
|
||||
|
||||
if(!matched)
|
||||
tag_client_with_current_selected(c, current_acf);
|
||||
break;
|
||||
}
|
||||
}
|
||||
tag_client_with_rules(c, current_acf);
|
||||
|
||||
screen_info = get_screen_info(current_acf->display, current_acf->screen, NULL);
|
||||
|
||||
|
@ -604,6 +577,39 @@ updatesizehints(Client *c)
|
|||
&& c->maxw == c->minw && c->maxh == c->minh);
|
||||
}
|
||||
|
||||
void
|
||||
tag_client_with_rules(Client *c, awesome_config *current_acf)
|
||||
{
|
||||
Rule *r;
|
||||
Bool matched = False;
|
||||
int i;
|
||||
|
||||
for(r = current_acf->rules; r; r = r->next)
|
||||
if(client_match_rule(c, r))
|
||||
{
|
||||
c->isfloating = r->isfloating;
|
||||
|
||||
if(r->screen != RULE_NOSCREEN && r->screen != c->screen)
|
||||
{
|
||||
current_acf = ¤t_acf[r->screen - current_acf->screen];
|
||||
move_client_to_screen(c, current_acf, True);
|
||||
}
|
||||
|
||||
for(i = 0; i < current_acf->ntags; i++)
|
||||
if(is_tag_match_rules(¤t_acf->tags[i], r))
|
||||
{
|
||||
matched = True;
|
||||
c->tags[i] = True;
|
||||
}
|
||||
else
|
||||
c->tags[i] = False;
|
||||
|
||||
if(!matched)
|
||||
tag_client_with_current_selected(c, current_acf);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/** Set selected client transparency
|
||||
* \param awesomeconf awesome config
|
||||
* \param arg unused arg
|
||||
|
|
1
client.h
1
client.h
|
@ -38,6 +38,7 @@ void client_unmanage(Client *, long, awesome_config *);
|
|||
inline void updatesizehints(Client *);
|
||||
void updatetitle(Client *);
|
||||
void saveprops(Client *, int);
|
||||
void tag_client_with_rules(Client *, awesome_config *);
|
||||
|
||||
UICB_PROTO(uicb_client_kill);
|
||||
UICB_PROTO(uicb_client_moveresize);
|
||||
|
|
2
event.c
2
event.c
|
@ -163,7 +163,7 @@ handle_event_configurerequest(XEvent * e, awesome_config *awesomeconf)
|
|||
drawstatusbar(&awesomeconf[old_screen]);
|
||||
drawstatusbar(&awesomeconf[c->screen]);
|
||||
}
|
||||
tag_client_with_current_selected(c, &awesomeconf[c->screen]);
|
||||
tag_client_with_rules(c, &awesomeconf[c->screen]);
|
||||
XMoveResizeWindow(e->xany.display, c->win, c->rx, c->ry, c->rw, c->rh);
|
||||
arrange(&awesomeconf[c->screen]);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue