diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-04-08 11:52:47 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-08 11:52:47 -0400 |
commit | ebabcc8b44846eaccdd34e3e48aa07d6bf7b58a7 (patch) | |
tree | 39d0e0ceaf8e025232b5e296eb92ac967e659a4b /sway | |
parent | efff7c4225a376157144eff99bef73feb165fb53 (diff) | |
parent | 5ebc99253ae04ee31d31b3f01bc0ce35f6ea5979 (diff) | |
download | sway-ebabcc8b44846eaccdd34e3e48aa07d6bf7b58a7.tar.xz |
Merge pull request #1777 from emersion/unmanaged-cursor-input
Use wlr_surface_point_accepts_input for unmanaged surfaces
Diffstat (limited to 'sway')
-rw-r--r-- | sway/input/cursor.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index cdded1c7..4bcf72fc 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c @@ -52,17 +52,13 @@ static struct sway_container *container_at_cursor(struct sway_cursor *cursor, wl_list_for_each_reverse(unmanaged_surface, unmanaged, link) { struct wlr_xwayland_surface *xsurface = unmanaged_surface->wlr_xwayland_surface; - struct wlr_box box = { - .x = unmanaged_surface->lx, - .y = unmanaged_surface->ly, - .width = xsurface->width, - .height = xsurface->height, - }; - - if (wlr_box_contains_point(&box, cursor->x, cursor->y)) { + + double _sx = cursor->x - unmanaged_surface->lx; + double _sy = cursor->y - unmanaged_surface->ly; + if (wlr_surface_point_accepts_input(xsurface->surface, _sx, _sy)) { *surface = xsurface->surface; - *sx = cursor->x - box.x; - *sy = cursor->y - box.y; + *sx = _sx; + *sy = _sy; return NULL; } } |