mirror of
https://codeberg.org/dwl/dwl.git
synced 2025-10-26 17:54:14 +00:00
fix mouse input being interpreted as top rel 0,0 if mouse is on border
This commit is contained in:
parent
2d9740c2fc
commit
43da2829e1
11
dwl.c
11
dwl.c
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user