move tclink in awesomeconf
This commit is contained in:
parent
899f84fce7
commit
14909f47a9
3
config.h
3
config.h
|
@ -210,7 +210,6 @@ typedef struct
|
|||
XColor colors_urgent[ColLast];
|
||||
/** Tag list */
|
||||
Tag *tags;
|
||||
TagClientLink *tclink;
|
||||
/** Layout list */
|
||||
Layout *layouts;
|
||||
/** Status bar */
|
||||
|
@ -269,6 +268,8 @@ struct AwesomeConf
|
|||
char *configpath;
|
||||
/** Selected clients on this tag */
|
||||
FocusList *focus;
|
||||
/** Link between tags and clients */
|
||||
TagClientLink *tclink;
|
||||
};
|
||||
|
||||
void config_parse(const char *);
|
||||
|
|
20
tag.c
20
tag.c
|
@ -32,15 +32,15 @@
|
|||
extern AwesomeConf globalconf;
|
||||
|
||||
static void
|
||||
detach_tagclientlink(int screen, TagClientLink *tc)
|
||||
detach_tagclientlink(TagClientLink *tc)
|
||||
{
|
||||
TagClientLink *tmp;
|
||||
|
||||
if(globalconf.screens[screen].tclink == tc)
|
||||
globalconf.screens[screen].tclink = tc->next;
|
||||
if(globalconf.tclink == tc)
|
||||
globalconf.tclink = tc->next;
|
||||
else
|
||||
{
|
||||
for(tmp = globalconf.screens[screen].tclink; tmp && tmp->next != tc; tmp = tmp->next);
|
||||
for(tmp = globalconf.tclink; tmp && tmp->next != tc; tmp = tmp->next);
|
||||
tmp->next = tc->next;
|
||||
}
|
||||
|
||||
|
@ -58,11 +58,11 @@ tag_client(Client *c, Tag *t)
|
|||
|
||||
new_tc = p_new(TagClientLink, 1);
|
||||
|
||||
if(!globalconf.screens[c->screen].tclink)
|
||||
globalconf.screens[c->screen].tclink = new_tc;
|
||||
if(!globalconf.tclink)
|
||||
globalconf.tclink = new_tc;
|
||||
else
|
||||
{
|
||||
for(tc = globalconf.screens[c->screen].tclink; tc->next; tc = tc->next);
|
||||
for(tc = globalconf.tclink; tc->next; tc = tc->next);
|
||||
tc->next = new_tc;
|
||||
}
|
||||
|
||||
|
@ -75,9 +75,9 @@ untag_client(Client *c, Tag *t)
|
|||
{
|
||||
TagClientLink *tc;
|
||||
|
||||
for(tc = globalconf.screens[c->screen].tclink; tc; tc = tc->next)
|
||||
for(tc = globalconf.tclink; tc; tc = tc->next)
|
||||
if(tc->client == c && tc->tag == t)
|
||||
detach_tagclientlink(c->screen, tc);
|
||||
detach_tagclientlink(tc);
|
||||
}
|
||||
|
||||
Bool
|
||||
|
@ -88,7 +88,7 @@ is_client_tagged(Client *c, Tag *t)
|
|||
if(!c)
|
||||
return False;
|
||||
|
||||
for(tc = globalconf.screens[c->screen].tclink; tc; tc = tc->next)
|
||||
for(tc = globalconf.tclink; tc; tc = tc->next)
|
||||
if(tc->client == c && tc->tag == t)
|
||||
return True;
|
||||
return False;
|
||||
|
|
Loading…
Reference in New Issue