move tag_client_with_rules() from client.c to tag.c
This commit is contained in:
parent
3a4fbce6f9
commit
781ebc8882
29
client.c
29
client.c
|
@ -561,35 +561,6 @@ client_updatesizehints(Client *c)
|
||||||
&& c->maxw == c->minw && c->maxh == c->minh);
|
&& c->maxw == c->minw && c->maxh == c->minh);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
tag_client_with_rules(Client *c, awesome_config *awesomeconf)
|
|
||||||
{
|
|
||||||
Rule *r;
|
|
||||||
Bool matched = False;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for(r = awesomeconf->rules; r; r = r->next)
|
|
||||||
if(client_match_rule(c, r))
|
|
||||||
{
|
|
||||||
c->isfloating = r->isfloating;
|
|
||||||
|
|
||||||
if(r->screen != RULE_NOSCREEN && r->screen != c->screen)
|
|
||||||
move_client_to_screen(c, awesomeconf, r->screen, True);
|
|
||||||
|
|
||||||
for(i = 0; i < awesomeconf->screens[c->screen].ntags; i++)
|
|
||||||
if(is_tag_match_rules(&awesomeconf->screens[c->screen].tags[i], r))
|
|
||||||
{
|
|
||||||
matched = True;
|
|
||||||
tag_client(&awesomeconf->screens[c->screen].tclink, c,
|
|
||||||
&awesomeconf->screens[c->screen].tags[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!matched)
|
|
||||||
tag_client_with_current_selected(c, &awesomeconf->screens[c->screen]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Returns True if a client is tagged
|
/** Returns True if a client is tagged
|
||||||
* with one of the tags
|
* with one of the tags
|
||||||
* \return True or False
|
* \return True or False
|
||||||
|
|
1
client.h
1
client.h
|
@ -37,7 +37,6 @@ void client_unmanage(Client *, long, awesome_config *);
|
||||||
void client_updatesizehints(Client *);
|
void client_updatesizehints(Client *);
|
||||||
void client_updatetitle(Client *);
|
void client_updatetitle(Client *);
|
||||||
void client_saveprops(Client *, VirtScreen *);
|
void client_saveprops(Client *, VirtScreen *);
|
||||||
void tag_client_with_rules(Client *, awesome_config *);
|
|
||||||
|
|
||||||
UICB_PROTO(uicb_client_kill);
|
UICB_PROTO(uicb_client_kill);
|
||||||
UICB_PROTO(uicb_client_moveresize);
|
UICB_PROTO(uicb_client_moveresize);
|
||||||
|
|
29
tag.c
29
tag.c
|
@ -105,6 +105,35 @@ tag_client_with_current_selected(Client *c, VirtScreen *screen)
|
||||||
untag_client(&screen->tclink, c, &screen->tags[i]);
|
untag_client(&screen->tclink, c, &screen->tags[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
tag_client_with_rules(Client *c, awesome_config *awesomeconf)
|
||||||
|
{
|
||||||
|
Rule *r;
|
||||||
|
Bool matched = False;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for(r = awesomeconf->rules; r; r = r->next)
|
||||||
|
if(client_match_rule(c, r))
|
||||||
|
{
|
||||||
|
c->isfloating = r->isfloating;
|
||||||
|
|
||||||
|
if(r->screen != RULE_NOSCREEN && r->screen != c->screen)
|
||||||
|
move_client_to_screen(c, awesomeconf, r->screen, True);
|
||||||
|
|
||||||
|
for(i = 0; i < awesomeconf->screens[c->screen].ntags; i++)
|
||||||
|
if(is_tag_match_rules(&awesomeconf->screens[c->screen].tags[i], r))
|
||||||
|
{
|
||||||
|
matched = True;
|
||||||
|
tag_client(&awesomeconf->screens[c->screen].tclink, c,
|
||||||
|
&awesomeconf->screens[c->screen].tags[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!matched)
|
||||||
|
tag_client_with_current_selected(c, &awesomeconf->screens[c->screen]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Tag selected window with tag
|
/** Tag selected window with tag
|
||||||
* \param arg Tag name
|
* \param arg Tag name
|
||||||
* \ingroup ui_callback
|
* \ingroup ui_callback
|
||||||
|
|
1
tag.h
1
tag.h
|
@ -31,6 +31,7 @@ void tag_client(TagClientLink **, Client *, Tag *);
|
||||||
void untag_client(TagClientLink **, Client *, Tag *);
|
void untag_client(TagClientLink **, Client *, Tag *);
|
||||||
Bool is_client_tagged(TagClientLink *, Client *, Tag *);
|
Bool is_client_tagged(TagClientLink *, Client *, Tag *);
|
||||||
void tag_client_with_current_selected(Client *, VirtScreen *);
|
void tag_client_with_current_selected(Client *, VirtScreen *);
|
||||||
|
void tag_client_with_rules(Client *, awesome_config *);
|
||||||
|
|
||||||
UICB_PROTO(uicb_client_tag);
|
UICB_PROTO(uicb_client_tag);
|
||||||
UICB_PROTO(uicb_client_togglefloating);
|
UICB_PROTO(uicb_client_togglefloating);
|
||||||
|
|
Loading…
Reference in New Issue