commit 73579df0d75446bf7121ddac571952775a2192f2
parent 826c6000e2aa0c3662f8d4b13b86e3cf0d9086df
Author: Enno Boland (tox) <tox@s01.de>
Date:   Wed, 28 Oct 2009 21:37:15 +0100
closing tab with middlemouse, circling tabs with mousewheel.
Diffstat:
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/tabbed.c b/tabbed.c
@@ -161,13 +161,27 @@ buttonpress(const XEvent *e) {
 	const XButtonPressedEvent *ev = &e->xbutton;
 	int i;
 	Client *c;
+	Arg arg;
 
 	c = getfirsttab();
 	if(c != clients && ev->x < TEXTW(before))
 		return;
 	for(i = 0; c; c = c->next, i++) {
 		if(c->tabx > ev->x) {
-			focus(c);
+			switch(ev->button) {
+			case Button1:
+				focus(c);
+				break;
+			case Button2:
+				focus(c);
+				killclient(NULL);
+				break;
+			case Button4:
+			case Button5:
+				arg.i = ev->button == Button4 ? -1 : 1;
+				rotate(&arg);
+				break;
+			}
 			break;
 		}
 	}