about summary refs log tree commit diff stats
path: root/bar.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <garbeam@wmii.de>2006-07-14 10:34:07 +0200
committerAnselm R. Garbe <garbeam@wmii.de>2006-07-14 10:34:07 +0200
commit6458d72572a30d2cc4af3385755033b2cca93057 (patch)
tree158be70ab7a84b729a66f0532c08aa7b336db217 /bar.c
parent9cd686c93a80b4095d4ee0960bef320ccd9ea02c (diff)
downloaddwm-6458d72572a30d2cc4af3385755033b2cca93057.tar.gz
made barclick to select the specific tag
Diffstat (limited to 'bar.c')
-rw-r--r--bar.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/bar.c b/bar.c
index 9914e56..ea4b946 100644
--- a/bar.c
+++ b/bar.c
@@ -6,6 +6,20 @@
 #include "dwm.h"
 
 void
+barclick(XButtonPressedEvent *e)
+{
+	int x = 0;
+	Arg a;
+	for(a.i = 0; a.i < TLast; a.i++) {
+		x += textw(tags[a.i]) + dc.font.height;
+		if(e->x < x) {
+			view(&a);
+			return;
+		}
+	}
+}
+
+void
 draw_bar()
 {
 	int i;
a> 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182