Skip to content

Commit

Permalink
seat: check destination != zero for mouse_warping container
Browse files Browse the repository at this point in the history
If mouse_warping container is set, the destination coordinates can be zero,
since the container may not have size yet.
  • Loading branch information
Emantor committed Oct 11, 2018
1 parent 8dadfd4 commit 4c64818
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sway/input/seat.c
Original file line number Diff line number Diff line change
Expand Up @@ -789,8 +789,10 @@ void seat_set_focus_warp(struct sway_seat *seat, struct sway_node *node,
new_output->wlr_output, seat->cursor->cursor->x,
seat->cursor->cursor->y)
|| config->mouse_warping == WARP_CONTAINER) {
wlr_cursor_warp(seat->cursor->cursor, NULL, x, y);
cursor_send_pointer_motion(seat->cursor, 0, true);
if (x != 0 && y != 0) {
wlr_cursor_warp(seat->cursor->cursor, NULL, x, y);
cursor_send_pointer_motion(seat->cursor, 0, true);
}
}
}
}
Expand Down

0 comments on commit 4c64818

Please sign in to comment.