JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
introduced tile.c, some refactoring of functions
[dwm.git] / main.c
diff --git a/main.c b/main.c
index 02475e0..bd19e49 100644 (file)
--- 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
@@ -117,7 +117,7 @@ setup(void) {
        wa.cursor = cursor[CurNormal];
        XChangeWindowAttributes(dpy, root, CWEventMask | CWCursor, &wa);
        grabkeys();
-       initrregs();
+       compileregexps();
        for(ntags = 0; tags[ntags]; ntags++);
        seltag = emallocz(sizeof(Bool) * ntags);
        seltag[0] = True;