Xinqi Bao's Git
projects
/
dwm.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
removed monocle for now
[dwm.git]
/
dwm.c
diff --git
a/dwm.c
b/dwm.c
index
d9e1c7f
..
f3254ae
100644
(file)
--- a/
dwm.c
+++ b/
dwm.c
@@
-145,13
+145,12
@@
void initfont(const char *fontstr);
Bool isoccupied(unsigned int t);
Bool isprotodel(Client *c);
Bool isurgent(unsigned int t);
Bool isoccupied(unsigned int t);
Bool isprotodel(Client *c);
Bool isurgent(unsigned int t);
-Bool isvisible(Client *c
, Bool *cmp
);
+Bool isvisible(Client *c);
void keypress(XEvent *e);
void killclient(const char *arg);
void manage(Window w, XWindowAttributes *wa);
void mappingnotify(XEvent *e);
void maprequest(XEvent *e);
void keypress(XEvent *e);
void killclient(const char *arg);
void manage(Window w, XWindowAttributes *wa);
void mappingnotify(XEvent *e);
void maprequest(XEvent *e);
-void monocle(void);
void movemouse(Client *c);
Client *nextunfloating(Client *c);
void propertynotify(XEvent *e);
void movemouse(Client *c);
Client *nextunfloating(Client *c);
void propertynotify(XEvent *e);
@@
-261,7
+260,7
@@
arrange(void) {
Client *c;
for(c = clients; c; c = c->next)
Client *c;
for(c = clients; c; c = c->next)
- if(isvisible(c
, NULL
)) {
+ if(isvisible(c)) {
unban(c);
if(!lt->arrange || c->isfloating)
resize(c, c->x, c->y, c->w, c->h, True);
unban(c);
if(!lt->arrange || c->isfloating)
resize(c, c->x, c->y, c->w, c->h, True);
@@
-441,7
+440,7
@@
configurerequest(XEvent *e) {
if((ev->value_mask & (CWX|CWY))
&& !(ev->value_mask & (CWWidth|CWHeight)))
configure(c);
if((ev->value_mask & (CWX|CWY))
&& !(ev->value_mask & (CWWidth|CWHeight)))
configure(c);
- if(isvisible(c
, NULL
))
+ if(isvisible(c))
XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
}
else
XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
}
else
@@
-494,7
+493,7
@@
drawbar(void) {
Client *c;
dc.x = 0;
Client *c;
dc.x = 0;
- for(c = stack; c && !isvisible(c
, NULL
); c = c->snext);
+ for(c = stack; c && !isvisible(c); c = c->snext);
for(i = 0; i < LENGTH(tags); i++) {
dc.w = textw(tags[i]);
if(tagset[seltags][i]) {
for(i = 0; i < LENGTH(tags); i++) {
dc.w = textw(tags[i]);
if(tagset[seltags][i]) {
@@
-634,8
+633,8
@@
expose(XEvent *e) {
void
focus(Client *c) {
void
focus(Client *c) {
- if(!c || (c && !isvisible(c
, NULL
)))
- for(c = stack; c && !isvisible(c
, NULL
); c = c->snext);
+ if(!c || (c && !isvisible(c)))
+ for(c = stack; c && !isvisible(c); c = c->snext);
if(sel && sel != c) {
grabbuttons(sel, False);
XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]);
if(sel && sel != c) {
grabbuttons(sel, False);
XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]);
@@
-669,9
+668,9
@@
focusnext(const char *arg) {
if(!sel)
return;
if(!sel)
return;
- for(c = sel->next; c && !isvisible(c
, arg ? sel->tags : NULL
); c = c->next);
+ for(c = sel->next; c && !isvisible(c); c = c->next);
if(!c)
if(!c)
- for(c = clients; c && !isvisible(c
, arg ? sel->tags : NULL
); c = c->next);
+ for(c = clients; c && !isvisible(c); c = c->next);
if(c) {
focus(c);
restack();
if(c) {
focus(c);
restack();
@@
-684,10
+683,10
@@
focusprev(const char *arg) {
if(!sel)
return;
if(!sel)
return;
- for(c = sel->prev; c && !isvisible(c
, arg ? sel->tags : NULL
); c = c->prev);
+ for(c = sel->prev; c && !isvisible(c); c = c->prev);
if(!c) {
for(c = clients; c && c->next; c = c->next);
if(!c) {
for(c = clients; c && c->next; c = c->next);
- for(; c && !isvisible(c
, arg ? sel->tags : NULL
); c = c->prev);
+ for(; c && !isvisible(c); c = c->prev);
}
if(c) {
focus(c);
}
if(c) {
focus(c);
@@
-888,13
+887,11
@@
isurgent(unsigned int t) {
}
Bool
}
Bool
-isvisible(Client *c
, Bool *cmp
) {
+isvisible(Client *c) {
unsigned int i;
unsigned int i;
- if(!cmp)
- cmp = tagset[seltags];
for(i = 0; i < LENGTH(tags); i++)
for(i = 0; i < LENGTH(tags); i++)
- if(c->tags[i] &&
cmp
[i])
+ if(c->tags[i] &&
tagset[seltags]
[i])
return True;
return False;
}
return True;
return False;
}
@@
-1014,15
+1011,6
@@
maprequest(XEvent *e) {
manage(ev->window, &wa);
}
manage(ev->window, &wa);
}
-void
-monocle(void) {
- Client *c;
-
- for(c = clients; c; c = c->next)
- if(!c->isfloating && isvisible(c, NULL))
- resize(c, wx, wy, ww - 2 * c->bw, wh - 2 * c->bw, RESIZEHINTS);
-}
-
void
movemouse(Client *c) {
int x1, y1, ocx, ocy, di, nx, ny;
void
movemouse(Client *c) {
int x1, y1, ocx, ocy, di, nx, ny;
@@
-1070,7
+1058,7
@@
movemouse(Client *c) {
Client *
nextunfloating(Client *c) {
Client *
nextunfloating(Client *c) {
- for(; c && (c->isfloating || !isvisible(c
, NULL
)); c = c->next);
+ for(; c && (c->isfloating || !isvisible(c)); c = c->next);
return c;
}
return c;
}
@@
-1230,7
+1218,7
@@
restack(void) {
wc.stack_mode = Below;
wc.sibling = barwin;
for(c = stack; c; c = c->snext)
wc.stack_mode = Below;
wc.sibling = barwin;
for(c = stack; c; c = c->snext)
- if(!c->isfloating && isvisible(c
, NULL
)) {
+ if(!c->isfloating && isvisible(c)) {
XConfigureWindow(dpy, c->win, CWSibling|CWStackMode, &wc);
wc.sibling = c->win;
}
XConfigureWindow(dpy, c->win, CWSibling|CWStackMode, &wc);
wc.sibling = c->win;
}