diff -r bd5cf635c601 event.c --- a/event.c Sun Aug 12 11:10:21 2007 +++ b/event.c Mon Aug 13 12:03:22 2007 @@ -118,6 +118,12 @@ buf[0] = 0; if(barwin == ev->window) { + if(ev->button == Button2) + zoom(NULL); + else if(ev->button == Button4) + focusclient("-1"); + else if(ev->button == Button5) + focusclient("1"); x = 0; for(i = 0; i < ntags; i++) { x += textw(tags[i]); @@ -138,8 +144,13 @@ return; } } - if((ev->x < x + blw) && ev->button == Button1) - setlayout(NULL); + if((ev->x < x + blw)) + if (ev->button == Button1) { + if(ev->state & MODKEY) + togglefloating(NULL); + else + setlayout(NULL); + } } else if((c = getclient(ev->window))) { focus(c); @@ -238,6 +249,10 @@ return; if((c = getclient(ev->window))) focus(c); + else if(ev->window == barwin && bpos == BarOff) { + XMoveWindow(dpy, barwin, sx, sy); + XSync(dpy, False); + } else if(ev->window == root) { selscreen = True; focus(NULL); @@ -279,6 +294,8 @@ selscreen = False; focus(NULL); } + else if(ev->window == barwin && bpos == BarOff) + updatebarpos(); } static void diff -r bd5cf635c601 layout.c --- a/layout.c Sun Aug 12 11:10:21 2007 +++ b/layout.c Mon Aug 13 12:03:22 2007 @@ -99,6 +99,8 @@ wc.sibling = c->win; } } + if(bpos == BarOff) + XRaiseWindow(dpy, barwin); XSync(dpy, False); while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); } diff -r bd5cf635c601 main.c --- a/main.c Sun Aug 12 11:10:21 2007 +++ b/main.c Mon Aug 13 12:03:22 2007 @@ -187,7 +187,7 @@ dc.h = bh = dc.font.height + 2; wa.override_redirect = 1; wa.background_pixmap = ParentRelative; - wa.event_mask = ButtonPressMask | ExposureMask; + wa.event_mask = ButtonPressMask | ExposureMask | EnterWindowMask | LeaveWindowMask; barwin = XCreateWindow(dpy, root, sx, sy, sw, bh, 0, DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen), CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa); @@ -241,7 +241,7 @@ XMoveWindow(dpy, barwin, sx, sy + wah); break; case BarOff: - XMoveWindow(dpy, barwin, sx, sy - bh); + XMoveWindow(dpy, barwin, sx -sw + BORDERPX, sy - bh + BORDERPX); break; } XSync(dpy, False);