aboutsummaryrefslogtreecommitdiff
path: root/sway/input/seatop_down.c
diff options
context:
space:
mode:
authorLas <las@protonmail.ch>2019-01-26 00:45:06 +0100
committeremersion <contact@emersion.fr>2019-01-30 19:53:59 +0100
commitcedde21c967ae5be0d1a9c7656ab8c6b3186ae42 (patch)
tree26c784ea3d6546d762a96b131a2cf23cee9a9c38 /sway/input/seatop_down.c
parent5cb3d4769cb055f542e6cb5fc979dd8f0fb9a8f3 (diff)
Implement pointer-constraints-unstable-v1
Diffstat (limited to 'sway/input/seatop_down.c')
-rw-r--r--sway/input/seatop_down.c11
1 files changed, 8 insertions, 3 deletions
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);
}
}