dwm

Kris's build of dwm
git clone git clone https://git.krisyotam.com/krisyotam/dwm.git
Log | Files | Refs | README | LICENSE

bar_wintitle_hidden.c (996B)


      1 int
      2 width_wintitle_hidden(Bar *bar, BarArg *a)
      3 {
      4 	return a->w;
      5 }
      6 
      7 int
      8 draw_wintitle_hidden(Bar *bar, BarArg *a)
      9 {
     10 	drw_rect(drw, a->x, a->y, a->w, a->h, 1, 1);
     11 	return calc_wintitle_hidden(bar->mon, a->x, a->w, -1, flextitledraw, NULL, a);
     12 }
     13 
     14 int
     15 click_wintitle_hidden(Bar *bar, Arg *arg, BarArg *a)
     16 {
     17 	calc_wintitle_hidden(bar->mon, 0, a->w, a->x, flextitleclick, arg, a);
     18 	return ClkWinTitle;
     19 }
     20 
     21 int
     22 calc_wintitle_hidden(
     23 	Monitor *m, int offx, int tabw, int passx,
     24 	void(*tabfn)(Monitor *, Client *, int, int, int, int, Arg *arg, BarArg *barg),
     25 	Arg *arg, BarArg *barg
     26 ) {
     27 	Client *c;
     28 	int clientsnhidden = 0, w, r;
     29 	int groupactive = GRP_HIDDEN;
     30 
     31 	for (c = m->clients; c; c = c->next) {
     32 		if (!ISVISIBLE(c))
     33 			continue;
     34 		if (HIDDEN(c))
     35 			clientsnhidden++;
     36 	}
     37 
     38 	if (!clientsnhidden)
     39 		return 0;
     40 
     41 	w = tabw / clientsnhidden;
     42 	r = tabw % clientsnhidden;
     43 	c = flextitledrawarea(m, m->clients, offx, r, w, clientsnhidden, SCHEMEFOR(GRP_HIDDEN), 0, 1, 0, passx, tabfn, arg, barg);
     44 	return 1;
     45 }
     46