comparison view.c @ 749:6692d7e7e156

added maxlayout by mitch, moved config.h to config.meillo.h, some smaller modifications
author meillo@marmaro.de
date Sun, 11 Feb 2007 17:20:22 +0100
parents 0f91934037b0
children
comparison
equal deleted inserted replaced
748:61821891835c 749:6692d7e7e156
115 focus(c); 115 focus(c);
116 } 116 }
117 restack(); 117 restack();
118 } 118 }
119 119
120 /* begin code by mitch */
121 void
122 arrangemax(Client *c) {
123 if(c == sel) {
124 c->ismax = True;
125 c->x = sx;
126 c->y = bh;
127 c->w = sw - 2 * BORDERPX;
128 c->h = sh - bh - 2 * BORDERPX;
129 XRaiseWindow(dpy, c->win);
130 } else {
131 c->ismax = False;
132 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
133 XLowerWindow(dpy, c->win);
134 }
135 }
136
137 void
138 domax(void) {
139 Client *c;
140
141 for(c = clients; c; c = c->next) {
142 if(isvisible(c)) {
143 if(c->isfloat) {
144 resize(c, True);
145 continue;
146 }
147 arrangemax(c);
148 resize(c, False);
149 } else {
150 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
151 }
152
153 }
154 if(!sel || !isvisible(sel)) {
155 for(c = stack; c && !isvisible(c); c = c->snext);
156 focus(c);
157 }
158 restack();
159 }
160 /* end code by mitch */
161
120 void 162 void
121 focusnext(Arg *arg) { 163 focusnext(Arg *arg) {
122 Client *c; 164 Client *c;
123 165
124 if(!sel) 166 if(!sel)
190 drawstatus(); 232 drawstatus();
191 if(!sel) 233 if(!sel)
192 return; 234 return;
193 if(sel->isfloat || arrange == dofloat) 235 if(sel->isfloat || arrange == dofloat)
194 XRaiseWindow(dpy, sel->win); 236 XRaiseWindow(dpy, sel->win);
195 if(arrange != dofloat) { 237
238 /* begin code by mitch */
239 if(arrange == domax) {
240 for(c = nexttiled(clients); c; c = nexttiled(c->next)) {
241 arrangemax(c);
242 resize(c, False);
243 }
244
245 } else if (arrange == dotile) {
246 /* end code by mitch */
247
196 if(!sel->isfloat) 248 if(!sel->isfloat)
197 XLowerWindow(dpy, sel->win); 249 XLowerWindow(dpy, sel->win);
198 for(c = nexttiled(clients); c; c = nexttiled(c->next)) { 250 for(c = nexttiled(clients); c; c = nexttiled(c->next)) {
199 if(c == sel) 251 if(c == sel)
200 continue; 252 continue;
213 arrange(); 265 arrange();
214 } 266 }
215 267
216 void 268 void
217 togglemode(Arg *arg) { 269 togglemode(Arg *arg) {
218 arrange = (arrange == dofloat) ? dotile : dofloat; 270 /* only toggle between tile and max - float is just available through togglefloat */
271 arrange = (arrange == dotile) ? domax : dotile;
219 if(sel) 272 if(sel)
220 arrange(); 273 arrange();
221 else 274 else
222 drawstatus(); 275 drawstatus();
223 } 276 }