From 781ebc888286be6cf859e72f453cbf54c2192a8f Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 14 Dec 2007 16:40:08 +0100 Subject: [PATCH] move tag_client_with_rules() from client.c to tag.c --- client.c | 29 ----------------------------- client.h | 1 - tag.c | 29 +++++++++++++++++++++++++++++ tag.h | 1 + 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/client.c b/client.c index 15a0d7d6..e7fe76a6 100644 --- a/client.c +++ b/client.c @@ -561,35 +561,6 @@ client_updatesizehints(Client *c) && 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 * with one of the tags * \return True or False diff --git a/client.h b/client.h index 370c7645..a312052f 100644 --- a/client.h +++ b/client.h @@ -37,7 +37,6 @@ void client_unmanage(Client *, long, awesome_config *); void client_updatesizehints(Client *); void client_updatetitle(Client *); void client_saveprops(Client *, VirtScreen *); -void tag_client_with_rules(Client *, awesome_config *); UICB_PROTO(uicb_client_kill); UICB_PROTO(uicb_client_moveresize); diff --git a/tag.c b/tag.c index 6cdf5a95..f58faf97 100644 --- a/tag.c +++ b/tag.c @@ -105,6 +105,35 @@ tag_client_with_current_selected(Client *c, VirtScreen *screen) 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 * \param arg Tag name * \ingroup ui_callback diff --git a/tag.h b/tag.h index 51bf5f7b..1c1eb813 100644 --- a/tag.h +++ b/tag.h @@ -31,6 +31,7 @@ void tag_client(TagClientLink **, Client *, Tag *); void untag_client(TagClientLink **, Client *, Tag *); Bool is_client_tagged(TagClientLink *, Client *, Tag *); 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_togglefloating);