fix mouse input being interpreted as top rel 0,0 if mouse is on border

This commit is contained in:
Palanix 2021-10-23 23:19:50 +02:00
parent 2d9740c2fc
commit 43da2829e1

11
dwl.c
View File

@ -2372,9 +2372,16 @@ xytoclient(double x, double y)
/* Find the topmost visible client (if any) at point (x, y), including
* borders. This relies on stack being ordered from top to bottom. */
Client *c;
wl_list_for_each(c, &stack, slink)
if (VISIBLEON(c, c->mon) && wlr_box_contains_point(&c->geom, x, y))
wl_list_for_each(c, &stack, slink) {
struct wlr_box p = {
.y = c->geom.y + borderpx,
.x = c->geom.x + borderpx,
.height = c->geom.height - 2*borderpx,
.width = c->geom.width - 2*borderpx,
};
if (VISIBLEON(c, c->mon) && wlr_box_contains_point(&p, x, y))
return c;
}
return NULL;
}