From cedde21c967ae5be0d1a9c7656ab8c6b3186ae42 Mon Sep 17 00:00:00 2001 From: Las Date: Sat, 26 Jan 2019 00:45:06 +0100 Subject: Implement pointer-constraints-unstable-v1 --- sway/input/seatop_down.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'sway/input/seatop_down.c') diff --git a/sway/input/seatop_down.c b/sway/input/seatop_down.c index c491e9c2..c2256c9a 100644 --- a/sway/input/seatop_down.c +++ b/sway/input/seatop_down.c @@ -26,14 +26,19 @@ static void handle_motion(struct sway_seat *seat, uint32_t time_msec) { static void handle_finish(struct sway_seat *seat) { struct seatop_down_event *e = seat->seatop_data; + struct sway_cursor *cursor = seat->cursor; // Set the cursor's previous coords to the x/y at the start of the // operation, so the container change will be detected if using // focus_follows_mouse and the cursor moved off the original container // during the operation. - seat->cursor->previous.x = e->ref_lx; - seat->cursor->previous.y = e->ref_ly; + cursor->previous.x = e->ref_lx; + cursor->previous.y = e->ref_ly; if (e->moved) { - cursor_send_pointer_motion(seat->cursor, 0); + struct wlr_surface *surface = NULL; + double sx, sy; + struct sway_node *node = node_at_coords(seat, + cursor->cursor->x, cursor->cursor->y, &surface, &sx, &sy); + cursor_send_pointer_motion(cursor, 0, node, surface, sx, sy); } } -- cgit v1.2.3