aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kanakarakis <ivan.kanak@gmail.com>2012-06-28 20:52:28 +0300
committerIvan Kanakarakis <ivan.kanak@gmail.com>2012-06-28 20:52:28 +0300
commit6ab139a2842e6ba7a7882241c4e5049b07d42721 (patch)
tree4619d6d48935eaec85ff910e21557823899c2078
parentf83d814ddfef0858a49baf38158e257723fb13e2 (diff)
rework wintoclient function main loop
-rw-r--r--monsterwm.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/monsterwm.c b/monsterwm.c
index 4865dbd..339cce5 100644
--- a/monsterwm.c
+++ b/monsterwm.c
@@ -874,8 +874,7 @@ void unmapnotify(XEvent *e) {
Client* wintoclient(Window w) {
Client *c = NULL;
int nd = -1, cd = currdeskidx;
- for (Bool found = False; nd<DESKTOPS-1 && !found;)
- for (selectdesktop(++nd), c=head; c && !(found = (w == c->win)); c=c->next);
+ while (nd<DESKTOPS-1 && !c) for (selectdesktop(++nd), c=head; c && w != c->win; c=c->next);
if (cd != nd) selectdesktop(cd);
return c;
}