Improve code of func "wintoclient"
This commit is contained in:
parent
16ff36d67b
commit
8d0b890b49
1 changed files with 7 additions and 6 deletions
13
src/dwm.c
13
src/dwm.c
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue