diff options
author | Tony Crisci <tony@dubstepdish.com> | 2018-01-15 10:19:49 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-15 10:19:49 -0500 |
commit | eb0f432a840dbe860b8c20f7a16e0281f9026326 (patch) | |
tree | a8b8e1a5a92a4203503ead496d8d50fd72fcf850 /sway/input | |
parent | 5a23959242419169fa4af032d85ee3f65e7041e4 (diff) | |
parent | ddc49ede4636b01dad8d8bfb7d0314bf1eb88258 (diff) |
Merge pull request #1566 from acrisci/render-loop
Subsurfaces and popups
Diffstat (limited to 'sway/input')
-rw-r--r-- | sway/input/cursor.c | 25 |
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) { |