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 5bb6e97..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,10 +219,8 @@ setlayout(const char *arg) {
 
 void
 togglebar(const char *arg) {
-       if(bpos == BarOff) {
-               if((bpos = BARPOS) == BarOff)
-                       bpos = BarTop;
-       }
+       if(bpos == BarOff)
+               bpos = (BARPOS == BarOff) ? BarTop : BARPOS;
        else
                bpos = BarOff;
        updatebarpos();