aboutsummaryrefslogtreecommitdiff
path: root/monsterwm.c
diff options
context:
space:
mode:
authorIvan Kanakarakis <ivan.kanak@gmail.com>2011-12-31 21:44:33 +0200
committerIvan Kanakarakis <ivan.kanak@gmail.com>2011-12-31 22:14:28 +0200
commitc1a9ca5c73484a6312ed42198baa7a152f9a6b79 (patch)
treea03efcbaec0e2fa7ca1f92901fbc9797790115dc /monsterwm.c
parent7a44355e562a857d8c6b973a3c2d6bb556b24ef4 (diff)
rework wintoclient() function
Diffstat (limited to 'monsterwm.c')
-rw-r--r--monsterwm.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/monsterwm.c b/monsterwm.c
index 1022476..121c2d6 100644
--- a/monsterwm.c
+++ b/monsterwm.c
@@ -646,12 +646,10 @@ void update_current(void) {
client* wintoclient(Window w) {
client *c = NULL;
Bool found = False;
- int cd = current_desktop;
- save_desktop(cd);
- for (int d=0; d<DESKTOPS && !found; d++) {
- select_desktop(d);
+ int d, cd;
+ save_desktop(cd = current_desktop);
+ for (select_desktop(d=0); d<DESKTOPS && !found; select_desktop(++d))
for (c=head; c; c=c->next) if ((found = (w == c->win))) break;
- }
select_desktop(cd);
return c;
}