mirror of
https://codeberg.org/dwl/dwl.git
synced 2026-04-08 08:21:00 -04: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
1 changed files with 9 additions and 2 deletions
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…
Add table
Add a link
Reference in a new issue