Improve code of func "wintomon"

This commit is contained in:
Alex Kotov 2021-11-20 22:14:57 +05:00
parent dfdd2b8a9e
commit 16ff36d67b
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
1 changed files with 11 additions and 6 deletions

View File

@ -1739,13 +1739,18 @@ Client *wintoclient(Window w)
Monitor *wintomon(Window w)
{
int x, y;
Client *c;
{
int x = 0, y = 0;
if (w == root && getrootptr(&x, &y)) {
return recttomon(x, y, 1, 1);
}
}
{
Client *c = wintoclient(w);
if (c) return c->mon;
}
if (w == root && getrootptr(&x, &y))
return recttomon(x, y, 1, 1);
if ((c = wintoclient(w)))
return c->mon;
return selmon;
}