Mercurial > hg > index.fcgi > dwm > dwm-3.6.1-12pba
comparison layout.c @ 15:85763b447d0f
add dwindle_m layout
author | paulo |
---|---|
date | Mon, 09 Apr 2018 20:08:44 -0600 |
parents | 162accc5d36d |
children |
comparison
equal
deleted
inserted
replaced
4:7994e82445b0 | 5:1ce73da552ed |
---|---|
66 } | 66 } |
67 restack(); | 67 restack(); |
68 } | 68 } |
69 | 69 |
70 static void | 70 static void |
71 dwindle_m(void) { | |
72 unsigned int i, j, n, nx, ny, nw, nh, mn, mr, mx, mw; | |
73 unsigned int m = 2; | |
74 //unsigned int m = nmaster; | |
75 Client *c; | |
76 | |
77 nx = wax; | |
78 //ny = way + wah; | |
79 ny = 0; | |
80 nw = waw; | |
81 nh = wah; | |
82 mx = nx; | |
83 mw = nw / m; | |
84 for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) | |
85 n++; | |
86 mn = n / m; | |
87 mr = n % m; | |
88 for(i = 0, j = 0, c = clients; c; c = c->next) | |
89 if(isvisible(c)) { | |
90 if(c->isbanned) | |
91 XMoveWindow(dpy, c->win, c->x, c->y); | |
92 c->isbanned = False; | |
93 if(c->isversatile) | |
94 continue; | |
95 c->ismax = False; | |
96 if((i % 2 && nh / 2 > 2 * c->border) | |
97 || (!(i % 2) && nw / 2 > 2 * c->border)) | |
98 { | |
99 if((j % m) == 0) { | |
100 if(i < mn - (mr > 0 ? 0 : 1)) { | |
101 if(i % 2) | |
102 nh /= 2; | |
103 else { | |
104 nw /= 2; | |
105 mw = nw / m; | |
106 } | |
107 } | |
108 else if(mr) | |
109 mw = nw / mr; | |
110 if((i % 4) == 0) | |
111 //ny -= nh; | |
112 ny += (i == 0 ? way : nh); | |
113 else if((i % 4) == 1) | |
114 nx += nw; | |
115 else if((i % 4) == 2) | |
116 ny += nh; | |
117 else | |
118 //nx -= nw; | |
119 nx += nw; | |
120 i++; | |
121 } | |
122 mx = nx + (j % m) * mw; | |
123 j++; | |
124 } | |
125 resize(c, mx, ny, mw - 2 * c->border, nh - 2 * c->border, False); | |
126 } | |
127 else { | |
128 c->isbanned = True; | |
129 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); | |
130 } | |
131 if(!sel || !isvisible(sel)) { | |
132 for(c = stack; c && !isvisible(c); c = c->snext); | |
133 focus(c); | |
134 } | |
135 restack(); | |
136 } | |
137 | |
138 static void | |
71 spiral_h(void) { | 139 spiral_h(void) { |
72 unsigned int i, n, nx, ny, nw, nh; | 140 unsigned int i, n, nx, ny, nw, nh; |
73 Client *c; | 141 Client *c; |
74 | 142 |
75 nx = wax + waw; | 143 nx = wax + waw; |