aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/cursor.c
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2018-04-08 11:43:18 -0400
committerLibravatar emersion <contact@emersion.fr>2018-04-08 11:43:18 -0400
commit5ebc99253ae04ee31d31b3f01bc0ce35f6ea5979 (patch)
tree39d0e0ceaf8e025232b5e296eb92ac967e659a4b /sway/input/cursor.c
parentMerge pull request #1776 from emersion/wlroots-remove-backend-egl (diff)
downloadsway-5ebc99253ae04ee31d31b3f01bc0ce35f6ea5979.tar.gz
sway-5ebc99253ae04ee31d31b3f01bc0ce35f6ea5979.tar.zst
sway-5ebc99253ae04ee31d31b3f01bc0ce35f6ea5979.zip
Use wlr_surface_point_accepts_input for unmanaged surfaces
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r--sway/input/cursor.c16
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,
52 wl_list_for_each_reverse(unmanaged_surface, unmanaged, link) { 52 wl_list_for_each_reverse(unmanaged_surface, unmanaged, link) {
53 struct wlr_xwayland_surface *xsurface = 53 struct wlr_xwayland_surface *xsurface =
54 unmanaged_surface->wlr_xwayland_surface; 54 unmanaged_surface->wlr_xwayland_surface;
55 struct wlr_box box = { 55
56 .x = unmanaged_surface->lx, 56 double _sx = cursor->x - unmanaged_surface->lx;
57 .y = unmanaged_surface->ly, 57 double _sy = cursor->y - unmanaged_surface->ly;
58 .width = xsurface->width, 58 if (wlr_surface_point_accepts_input(xsurface->surface, _sx, _sy)) {
59 .height = xsurface->height,
60 };
61
62 if (wlr_box_contains_point(&box, cursor->x, cursor->y)) {
63 *surface = xsurface->surface; 59 *surface = xsurface->surface;
64 *sx = cursor->x - box.x; 60 *sx = _sx;
65 *sy = cursor->y - box.y; 61 *sy = _sy;
66 return NULL; 62 return NULL;
67 } 63 }
68 } 64 }