JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
minor bugfix
[dwm.git] / dwm.c
diff --git a/dwm.c b/dwm.c
index a9edae3..0071379 100644 (file)
--- a/dwm.c
+++ b/dwm.c
@@ -96,7 +96,8 @@ typedef struct {
        const char *symbol;
        void (*arrange)(void);
        Bool isfloating;
-} Layout;
+} Layout; /* TODO: layout should keep an auxilliary pointer to its Geometry,
+            instead of having all those layout specific vars globally */
 
 typedef struct {
        const char *prop;
@@ -178,6 +179,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 +409,7 @@ configurenotify(XEvent *e) {
 
        if(ev->window == root && (ev->width != sw || ev->height != sh)) {
                setgeoms();
+               updatebarpos();
                arrange();
        }
 }
@@ -1404,7 +1407,7 @@ setdefaultgeoms(void) {
        mh = wh;
 
        /* tile area */
-       tx = wx;
+       tx = mx + mw;
        ty = wy;
        tw = ww - mw;
        th = wh;
@@ -1414,11 +1417,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 +1741,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;