tag.c
changeset 430 1e8aba00964e
parent 429 a31de8605f72
child 431 a230e4432bb7
equal deleted inserted replaced
429:a31de8605f72 430:1e8aba00964e
   104 			XFree(ch.res_name);
   104 			XFree(ch.res_name);
   105 	}
   105 	}
   106 	if(!matched)
   106 	if(!matched)
   107 		for(i = 0; i < ntags; i++)
   107 		for(i = 0; i < ntags; i++)
   108 			c->tags[i] = seltag[i];
   108 			c->tags[i] = seltag[i];
   109 	if(!c->isfloat)
   109 	for(c->weight = 0; c->weight < ntags && !c->tags[c->weight]; c->weight++);
   110 		for(c->weight = 0; c->weight < ntags && !c->tags[c->weight]; c->weight++);
       
   111 }
   110 }
   112 
   111 
   113 void
   112 void
   114 tag(Arg *arg)
   113 tag(Arg *arg)
   115 {
   114 {
   119 		return;
   118 		return;
   120 
   119 
   121 	for(i = 0; i < ntags; i++)
   120 	for(i = 0; i < ntags; i++)
   122 		sel->tags[i] = False;
   121 		sel->tags[i] = False;
   123 	sel->tags[arg->i] = True;
   122 	sel->tags[arg->i] = True;
   124 	if(!sel->isfloat)
   123 	sel->weight = arg->i;
   125 		sel->weight = arg->i;
       
   126 	arrange(NULL);
   124 	arrange(NULL);
   127 }
   125 }
   128 
   126 
   129 void
   127 void
   130 toggletag(Arg *arg)
   128 toggletag(Arg *arg)
   136 
   134 
   137 	sel->tags[arg->i] = !sel->tags[arg->i];
   135 	sel->tags[arg->i] = !sel->tags[arg->i];
   138 	for(i = 0; i < ntags && !sel->tags[i]; i++);
   136 	for(i = 0; i < ntags && !sel->tags[i]; i++);
   139 	if(i == ntags)
   137 	if(i == ntags)
   140 		sel->tags[arg->i] = True;
   138 		sel->tags[arg->i] = True;
   141 	if(!sel->isfloat)
   139 	sel->weight = (i == ntags) ? arg->i : i;
   142 		sel->weight = (i == ntags) ? arg->i : i;
       
   143 	arrange(NULL);
   140 	arrange(NULL);
   144 }
   141 }