JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
raise barwin in restack, that's the most elegant solution I think
[dwm.git] / layout.c
index 26e9de6..0f17b69 100644 (file)
--- a/layout.c
+++ b/layout.c
@@ -189,6 +189,7 @@ restack(void) {
                        XLowerWindow(dpy, c->win);
                }
        }
+       XRaiseWindow(dpy, barwin);
        XSync(dpy, False);
        while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
 }
@@ -218,7 +219,10 @@ setlayout(const char *arg) {
 
 void
 togglebar(const char *arg) {
-       bpos = (bpos == BarOff) ? BARPOS : BarOff;
+       if(bpos == BarOff)
+               bpos = (BARPOS == BarOff) ? BarTop : BARPOS;
+       else
+               bpos = BarOff;
        updatebarpos();
        lt->arrange();
 }