JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
applied Jukka's sizeof K&R compliance patch, applied Manuels' last-line printage...
[dwm.git] / client.c
index 60f1cbe..74cadb5 100644 (file)
--- a/client.c
+++ b/client.c
@@ -202,12 +202,12 @@ manage(Window w, XWindowAttributes *wa) {
        c = emallocz(sizeof(Client));
        c->tags = emallocz(ntags * sizeof(Bool));
        c->win = w;
+       c->border = 0;
        c->x = c->tx = wa->x;
        c->y = c->ty = wa->y;
        c->w = c->tw = wa->width;
        c->h = wa->height;
        c->th = bh;
-       c->border = 0;
        updatesize(c);
        if(c->x + c->w + 2 * BORDERPX > sw)
                c->x = sw - c->w - 2 * BORDERPX;
@@ -232,9 +232,7 @@ manage(Window w, XWindowAttributes *wa) {
        updatetitle(c);
        settags(c, getclient(trans));
        if(!c->isfloat)
-               c->isfloat = trans
-                       || (c->maxw && c->minw &&
-                               c->maxw == c->minw && c->maxh == c->minh);
+               c->isfloat = trans || c->isfixed;
        resizetitle(c);
        if(clients)
                clients->prev = c;
@@ -246,7 +244,7 @@ manage(Window w, XWindowAttributes *wa) {
        XMapWindow(dpy, c->twin);
        if(isvisible(c))
                focus(c);
-       arrange(NULL);
+       arrange();
 }
 
 void
@@ -341,6 +339,8 @@ updatesize(Client *c) {
        }
        else
                c->minw = c->minh = 0;
+       c->isfixed = (c->maxw && c->minw && c->maxh && c->minh &&
+                               c->maxw == c->minw && c->maxh == c->minh);
        if(c->flags & PWinGravity)
                c->grav = size.win_gravity;
        else
@@ -361,12 +361,12 @@ updatetitle(Client *c) {
        if(!name.nitems)
                return;
        if(name.encoding == XA_STRING)
-               strncpy(c->name, (char *)name.value, sizeof(c->name));
+               strncpy(c->name, (char *)name.value, sizeof c->name);
        else {
                if(XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success
                                && n > 0 && *list)
                {
-                       strncpy(c->name, *list, sizeof(c->name));
+                       strncpy(c->name, *list, sizeof c->name);
                        XFreeStringList(list);
                }
        }
@@ -393,5 +393,5 @@ unmanage(Client *c) {
        XSync(dpy, False);
        XSetErrorHandler(xerror);
        XUngrabServer(dpy);
-       arrange(NULL);
+       arrange();
 }