tag_client_with_rule() only tag is a rule match
This commit is contained in:
parent
47ee745425
commit
94197429e5
3
client.c
3
client.c
|
@ -275,8 +275,7 @@ client_manage(Window w, XWindowAttributes *wa, int screen)
|
|||
move_client_to_screen(c, rule->screen, True);
|
||||
else
|
||||
move_client_to_screen(c, screen, True);
|
||||
if(!tag_client_with_rule(c, rule))
|
||||
tag_client_with_current_selected(c);
|
||||
tag_client_with_rule(c, rule);
|
||||
}
|
||||
else
|
||||
move_client_to_screen(c, screen, True);
|
||||
|
|
15
tag.c
15
tag.c
|
@ -93,25 +93,28 @@ tag_client_with_current_selected(Client *c)
|
|||
untag_client(c, tag);
|
||||
}
|
||||
|
||||
Bool
|
||||
void
|
||||
tag_client_with_rule(Client *c, Rule *r)
|
||||
{
|
||||
Tag *tag;
|
||||
Bool matched = False;
|
||||
|
||||
if(!r)
|
||||
return False;
|
||||
if(!r) return;
|
||||
|
||||
/* check if at least one tag match */
|
||||
for(tag = globalconf.screens[c->screen].tags; tag; tag = tag->next)
|
||||
if(tag_match_rule(tag, r))
|
||||
{
|
||||
matched = True;
|
||||
tag_client(c, tag);
|
||||
break;
|
||||
}
|
||||
|
||||
if(matched)
|
||||
for(tag = globalconf.screens[c->screen].tags; tag; tag = tag->next)
|
||||
if(tag_match_rule(tag, r))
|
||||
tag_client(c, tag);
|
||||
else
|
||||
untag_client(c, tag);
|
||||
|
||||
return matched;
|
||||
}
|
||||
|
||||
Tag **
|
||||
|
|
2
tag.h
2
tag.h
|
@ -31,7 +31,7 @@ Tag ** get_current_tags(int );
|
|||
void tag_client(Client *, Tag *);
|
||||
void untag_client(Client *, Tag *);
|
||||
Bool is_client_tagged(Client *, Tag *);
|
||||
Bool tag_client_with_rule(Client *, Rule *r);
|
||||
void tag_client_with_rule(Client *, Rule *r);
|
||||
void tag_client_with_current_selected(Client *);
|
||||
void tag_view_only_byindex(int, int);
|
||||
|
||||
|
|
Loading…
Reference in New Issue