about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--dwm.16
-rw-r--r--event.c11
2 files changed, 15 insertions, 2 deletions
diff --git a/dwm.1 b/dwm.1
index 4e23f1c..6a75b1d 100644
--- a/dwm.1
+++ b/dwm.1
@@ -47,6 +47,12 @@ and
 .B floating
 mode.
 .TP
+.B Button2
+click on a tag label adds/removes that
+.B tag
+to/from the focused
+.B window.
+.TP
 .B Button3
 click on a tag label adds/removes all windows with that
 .B tag
diff --git a/event.c b/event.c
index bdf4071..e97abad 100644
--- a/event.c
+++ b/event.c
@@ -109,10 +109,17 @@ buttonpress(XEvent *e)
 		for(a.i = 0; a.i < ntags; a.i++) {
 			x += textw(tags[a.i]);
 			if(ev->x < x) {
-				if(ev->button == Button1)
+				switch(ev->button) {
+				case Button1:
 					view(&a);
-				else if(ev->button == Button3)
+					break;
+				case Button2:
+					toggletag(&a);
+					break;
+				case Button3:
 					toggleview(&a);
+					break;
+				}
 				return;
 			}
 		}
='#n141'>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