Improve code of func "wintomon"
This commit is contained in:
parent
dfdd2b8a9e
commit
16ff36d67b
17
src/dwm.c
17
src/dwm.c
|
@ -1739,13 +1739,18 @@ Client *wintoclient(Window w)
|
||||||
|
|
||||||
Monitor *wintomon(Window w)
|
Monitor *wintomon(Window w)
|
||||||
{
|
{
|
||||||
int x, y;
|
{
|
||||||
Client *c;
|
int x = 0, y = 0;
|
||||||
|
if (w == root && getrootptr(&x, &y)) {
|
||||||
if (w == root && getrootptr(&x, &y))
|
|
||||||
return recttomon(x, y, 1, 1);
|
return recttomon(x, y, 1, 1);
|
||||||
if ((c = wintoclient(w)))
|
}
|
||||||
return c->mon;
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
Client *c = wintoclient(w);
|
||||||
|
if (c) return c->mon;
|
||||||
|
}
|
||||||
|
|
||||||
return selmon;
|
return selmon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue