Xinqi Bao's Git
projects
/
dwm.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
I change the style of init somewhat, init as early as possible.
[dwm.git]
/
layout.c
diff --git
a/layout.c
b/layout.c
index
4b4e908
..
acf0a8e
100644
(file)
--- a/
layout.c
+++ b/
layout.c
@@
-1,6
+1,4
@@
-/* © 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
- * © 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
- * See LICENSE file for license details. */
+/* See LICENSE file for copyright and license details. */
#include "dwm.h"
#include <stdlib.h>
#include "dwm.h"
#include <stdlib.h>
@@
-28,9
+26,7
@@
tile(void) {
for(i = 0, c = clients; c; c = c->next)
if(isvisible(c)) {
for(i = 0, c = clients; c; c = c->next)
if(isvisible(c)) {
- if(c->isbanned)
- XMoveWindow(dpy, c->win, c->x, c->y);
- c->isbanned = False;
+ unban(c);
if(c->isfloating)
continue;
c->ismax = False;
if(c->isfloating)
continue;
c->ismax = False;
@@
-60,12
+56,9
@@
tile(void) {
resize(c, nx, ny, nw, nh, False);
i++;
}
resize(c, nx, ny, nw, nh, False);
i++;
}
- else {
- c->isbanned = True;
- XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
- }
- if(!sel || !isvisible(sel))
- focustopvisible();
+ else
+ ban(c);
+ focus(NULL);
restack();
}
restack();
}
@@
-77,20
+70,14
@@
void
floating(void) {
Client *c;
floating(void) {
Client *c;
- for(c = clients; c; c = c->next)
{
+ for(c = clients; c; c = c->next)
if(isvisible(c)) {
if(isvisible(c)) {
- if(c->isbanned)
- XMoveWindow(dpy, c->win, c->x, c->y);
- c->isbanned = False;
+ unban(c);
resize(c, c->x, c->y, c->w, c->h, True);
}
resize(c, c->x, c->y, c->w, c->h, True);
}
- else {
- c->isbanned = True;
- XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
- }
- }
- if(!sel || !isvisible(sel))
- focustopvisible();
+ else
+ ban(c);
+ focus(NULL);
restack();
}
restack();
}
@@
-238,7
+225,7
@@
togglemax(const char *arg) {
sel->ry = sel->y;
sel->rw = sel->w;
sel->rh = sel->h;
sel->ry = sel->y;
sel->rw = sel->w;
sel->rh = sel->h;
- resize(sel, wax, way, waw - 2 *
BORDERPX, wah - 2 * BORDERPX
, True);
+ resize(sel, wax, way, waw - 2 *
sel->border, wah - 2 * sel->border
, True);
}
else
resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True);
}
else
resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True);