aboutsummaryrefslogtreecommitdiff
path: root/sway/input/cursor.c
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2018-01-14 13:19:21 -0500
committerTony Crisci <tony@dubstepdish.com>2018-01-14 13:19:21 -0500
commit83ddd2d9dbee1b77993f5cc45427854e18aae6f1 (patch)
treef2ec5fbc8b47b66f85978aa7feb1a09e34aaf569 /sway/input/cursor.c
parent2ce1d8d6cd0ae1520ea191678e3c39d555c66b58 (diff)
render override redirect
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r--sway/input/cursor.c25
1 files changed, 25 insertions, 0 deletions
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) {