~kris/suckless

tabbed

73579df0d75446bf7121ddac571952775a2192f2 — Enno Boland (tox) 16 years ago 826c600
closing tab with middlemouse, circling tabs with mousewheel.
1 files changed, 15 insertions(+), 1 deletions(-)

M tabbed.c
M tabbed.c => tabbed.c +15 -1
@@ 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;
		}
	}