From 0aaa9a21f334a5c75b7efce2712384f57bd370cd Mon Sep 17 00:00:00 2001 From: Anselm R. Garbe Date: Tue, 18 Jul 2006 11:45:32 +0200 Subject: pop on heretag --- client.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'client.c') diff --git a/client.c b/client.c index 166e979..fa48644 100644 --- a/client.c +++ b/client.c @@ -267,6 +267,18 @@ maximize(Arg *arg) resize(sel, False); } +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) { @@ -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); } -- cgit v1.2.3