Improve code of func "wintoclient"

This commit is contained in:
Alex Kotov 2021-11-20 22:15:54 +05:00
parent 16ff36d67b
commit 8d0b890b49
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08

View file

@ -1727,13 +1727,14 @@ void updatewmhints(Client *c)
Client *wintoclient(Window w)
{
Client *c;
Monitor *m;
for (m = mons; m; m = m->next)
for (c = m->clients; c; c = c->next)
if (c->win == w)
for (Monitor *m = mons; m; m = m->next) {
for (Client *c = m->clients; c; c = c->next) {
if (c->win == w) {
return c;
}
}
}
return NULL;
}