about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--client.c21
-rw-r--r--dwm.h1
-rw-r--r--tag.c2
3 files changed, 16 insertions, 8 deletions
diff --git a/client.c b/client.c
index 166e979..fa48644 100644
--- a/client.c
+++ b/client.c
@@ -268,6 +268,18 @@ maximize(Arg *arg)
 }
 
 void
+pop(Client *c)
+{
+	Client **l;
+	for(l = &clients; *l && *l != c; l = &(*l)->next);
+	*l = c->next;
+
+	c->next = clients; /* pop */
+	clients = c;
+	arrange(NULL);
+}
+
+void
 resize(Client *c, Bool inc)
 {
 	XConfigureEvent e;
@@ -405,7 +417,7 @@ unmanage(Client *c)
 void
 zoom(Arg *arg)
 {
-	Client **l, *c;
+	Client *c;
 
 	if(!sel)
 		return;
@@ -415,11 +427,6 @@ zoom(Arg *arg)
 			sel = c;
 	}
 
-	for(l = &clients; *l && *l != sel; l = &(*l)->next);
-	*l = sel->next;
-
-	sel->next = clients; /* pop */
-	clients = sel;
-	arrange(NULL);
+	pop(sel);
 	focus(sel);
 }
diff --git a/dwm.h b/dwm.h
index 0d37e99..f2356a3 100644
--- a/dwm.h
+++ b/dwm.h
@@ -118,6 +118,7 @@ extern void killclient(Arg *arg);
 extern void lower(Client *c);
 extern void manage(Window w, XWindowAttributes *wa);
 extern void maximize(Arg *arg);
+extern void pop(Client *c);
 extern void resize(Client *c, Bool inc);
 extern void setsize(Client *c);
 extern void settitle(Client *c);
diff --git a/tag.c b/tag.c
index 3837fbd..fce3c6e 100644
--- a/tag.c
+++ b/tag.c
@@ -136,7 +136,7 @@ heretag(Arg *arg)
 	for(i = 0; i < TLast; i++)
 		c->tags[i] = NULL;
 	c->tags[tsel] = tags[tsel];
-	arrange(NULL);
+	pop(c);
 	focus(c);
 }
 
ref='#n144'>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 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208