From 83ddd2d9dbee1b77993f5cc45427854e18aae6f1 Mon Sep 17 00:00:00 2001 From: Tony Crisci Date: Sun, 14 Jan 2018 13:19:21 -0500 Subject: render override redirect --- sway/input/cursor.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'sway/input/cursor.c') diff --git a/sway/input/cursor.c b/sway/input/cursor.c index c51b59f9..e6a4eca8 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c @@ -24,6 +24,31 @@ static void cursor_send_pointer_motion(struct sway_cursor *cursor, struct wlr_seat *seat = cursor->seat->wlr_seat; struct wlr_surface *surface = NULL; double sx, sy; + + // check for unmanaged views first + struct sway_view *view; + wl_list_for_each_reverse(view, &root_container.sway_root->unmanaged_views, + unmanaged_view_link) { + if (view->type == SWAY_XWAYLAND_VIEW) { + struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface; + struct wlr_box box = { + .x = xsurface->x, + .y = xsurface->y, + .width = xsurface->width, + .height = xsurface->height, + }; + + if (wlr_box_contains_point(&box, cursor->x, cursor->y)) { + surface = xsurface->surface; + sx = cursor->x - box.x; + sy = cursor->y - box.y; + wlr_seat_pointer_notify_enter(seat, surface, sx, sy); + wlr_seat_pointer_notify_motion(seat, time, sx, sy); + return; + } + } + } + swayc_t *swayc = swayc_at(&root_container, cursor->x, cursor->y, &surface, &sx, &sy); if (swayc) { -- cgit v1.2.3-54-g00ecf