X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=main.c;h=5ed8981c4a13d1bb0788d145d2f8232210856317;hb=3167373512c562f8f040203d2ee29084c76d00a0;hp=1fd7ab1329df38bff3ebfb78d6eed4122fe12617;hpb=e39e6979981ea0308f89fde96bd81c45359dcdfd;p=dwm.git diff --git a/main.c b/main.c index 1fd7ab1..5ed8981 100644 --- a/main.c +++ b/main.c @@ -41,7 +41,8 @@ static void cleanup(void) { close(STDIN_FILENO); while(stack) { - resize(stack, True); + if(stack->isbanned) + XMoveWindow(dpy, stack->win, stack->x, stack->y); unmanage(stack); } if(dc.font.set) @@ -69,9 +70,8 @@ scan(void) { wins = NULL; if(XQueryTree(dpy, root, &d1, &d2, &wins, &num)) { for(i = 0; i < num; i++) { - if(!XGetWindowAttributes(dpy, wins[i], &wa)) - continue; - if(wa.override_redirect || XGetTransientForHint(dpy, wins[i], &d1)) + if(!XGetWindowAttributes(dpy, wins[i], &wa) + || wa.override_redirect || XGetTransientForHint(dpy, wins[i], &d1)) continue; if(wa.map_state == IsViewable) manage(wins[i], &wa); @@ -104,12 +104,12 @@ setup(void) { /* init modifier map */ numlockmask = 0; modmap = XGetModifierMapping(dpy); - for (i = 0; i < 8; i++) { + for (i = 0; i < 8; i++) for (j = 0; j < modmap->max_keypermod; j++) { - if(modmap->modifiermap[i * modmap->max_keypermod + j] == XKeysymToKeycode(dpy, XK_Num_Lock)) + if(modmap->modifiermap[i * modmap->max_keypermod + j] + == XKeysymToKeycode(dpy, XK_Num_Lock)) numlockmask = (1 << i); } - } XFreeModifiermap(modmap); /* select for events */ wa.event_mask = SubstructureRedirectMask | SubstructureNotifyMask @@ -273,7 +273,7 @@ main(int argc, char *argv[]) { break; default: for(stext[r] = '\0', p = stext + strlen(stext) - 1; p >= stext && *p == '\n'; *p-- = '\0'); - for(p = stext + strlen(stext) - 1; p >= stext && *p != '\n'; --p); + for(; p >= stext && *p != '\n'; --p); if(p > stext) strncpy(stext, p + 1, sizeof stext); }