mirror of
https://github.com/pikami/dwm.git
synced 2024-12-05 01:55:43 +00:00
applied anonymous code cleanup patch
This commit is contained in:
parent
69e7d7dfd3
commit
a372248b80
16
dwm.c
16
dwm.c
@ -433,9 +433,9 @@ buttonpress(XEvent *e) {
|
||||
}
|
||||
if(ev->window == selmon->barwin) {
|
||||
i = x = 0;
|
||||
do {
|
||||
do
|
||||
x += TEXTW(tags[i]);
|
||||
} while(ev->x >= x && ++i < LENGTH(tags));
|
||||
while(ev->x >= x && ++i < LENGTH(tags));
|
||||
if(i < LENGTH(tags)) {
|
||||
click = ClkTagBar;
|
||||
arg.ui = 1 << i;
|
||||
@ -720,12 +720,10 @@ dirtomon(int dir) {
|
||||
if(!(m = selmon->next))
|
||||
m = mons;
|
||||
}
|
||||
else {
|
||||
if(selmon == mons)
|
||||
else if(selmon == mons)
|
||||
for(m = mons; m->next; m = m->next);
|
||||
else
|
||||
for(m = mons; m->next != selmon; m = m->next);
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
@ -1017,21 +1015,19 @@ grabkeys(void) {
|
||||
KeyCode code;
|
||||
|
||||
XUngrabKey(dpy, AnyKey, AnyModifier, root);
|
||||
for(i = 0; i < LENGTH(keys); i++) {
|
||||
for(i = 0; i < LENGTH(keys); i++)
|
||||
if((code = XKeysymToKeycode(dpy, keys[i].keysym)))
|
||||
for(j = 0; j < LENGTH(modifiers); j++)
|
||||
XGrabKey(dpy, code, keys[i].mod | modifiers[j], root,
|
||||
True, GrabModeAsync, GrabModeAsync);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
initfont(const char *fontstr) {
|
||||
char *def, **missing;
|
||||
int n;
|
||||
|
||||
missing = NULL;
|
||||
dc.font.set = XCreateFontSet(dpy, fontstr, &missing, &n, &def);
|
||||
if(missing) {
|
||||
while(n--)
|
||||
@ -1311,6 +1307,7 @@ ptrtomon(int x, int y) {
|
||||
return m;
|
||||
return selmon;
|
||||
}
|
||||
|
||||
void
|
||||
quit(const Arg *arg) {
|
||||
running = False;
|
||||
@ -1415,11 +1412,10 @@ run(void) {
|
||||
XEvent ev;
|
||||
/* main event loop */
|
||||
XSync(dpy, False);
|
||||
while(running && !XNextEvent(dpy, &ev)) {
|
||||
while(running && !XNextEvent(dpy, &ev))
|
||||
if(handler[ev.type])
|
||||
handler[ev.type](&ev); /* call handler */
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
scan(void) {
|
||||
|
Loading…
Reference in New Issue
Block a user