JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
some cleanup
[dwm.git] / dwm.c
diff --git a/dwm.c b/dwm.c
index a9edae3..51d270e 100644 (file)
--- a/dwm.c
+++ b/dwm.c
@@ -178,6 +178,7 @@ void toggleview(const char *arg);
 void unban(Client *c);
 void unmanage(Client *c);
 void unmapnotify(XEvent *e);
+void updatebarpos(void);
 void updatesizehints(Client *c);
 void updatetitle(Client *c);
 void updatewmhints(Client *c);
@@ -407,6 +408,7 @@ configurenotify(XEvent *e) {
 
        if(ev->window == root && (ev->width != sw || ev->height != sh)) {
                setgeoms();
+               updatebarpos();
                arrange();
        }
 }
@@ -1414,11 +1416,6 @@ setdefaultgeoms(void) {
        moy = wy;
        mow = ww;
        moh = wh;
-
-       if(dc.drawable != 0)
-               XFreePixmap(dpy, dc.drawable);
-       dc.drawable = XCreatePixmap(dpy, root, bw, bh, DefaultDepth(dpy, screen));
-       XMoveResizeWindow(dpy, barwin, bx, by, bw, bh);
 }
 
 void
@@ -1743,6 +1740,15 @@ unmapnotify(XEvent *e) {
 }
 
 void
+updatebarpos(void) {
+
+       if(dc.drawable != 0)
+               XFreePixmap(dpy, dc.drawable);
+       dc.drawable = XCreatePixmap(dpy, root, bw, bh, DefaultDepth(dpy, screen));
+       XMoveResizeWindow(dpy, barwin, bx, by, bw, bh);
+}
+
+void
 updatesizehints(Client *c) {
        long msize;
        XSizeHints size;