this time with the real file!

2007/8/13, y i y u s <[EMAIL PROTECTED]>:
> this patch (which works with yesterday hg tip, dunno if there have
> been any changes) is an autohide mode for the tag bar.
> i had always hated autohiding bars, but the other day reading
> http://www.asktog.com/columns/022DesignedToGiveFitts.html and after
> some experimentation with bwm i decided to try it showing the bar when
> you go to the upper left corner.
> the patch also adds some new functions with the mouse (when 4.4 is
> relased, i will update the patch with the diff of the man page to
> document these changes):
> Button 2: zoom
> MouseWheel: focus prev/next client
> ModKey+Button1 in the arrangement symbol: toggle floating
> the only problem i have found is that the autohidden bar is always at
> the top, if somebody wants to use this patch with the bar at the
> bottom drop me a line.
>
> ps: im still trying new ideas with bwm, 0.2 will probably be relased
> the next week, thanks to anselm for his advice (im reimplementing
> everything with XReparentWindow as you told me, rio sources in
> plan9ports is being very helpful)
>
> --
>
>
> - yiyus || JGL .
>
>


-- 


- yiyus || JGL .
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);

Reply via email to