Skip to content

Commit

Permalink
view: rewarp cursor during view_unmap
Browse files Browse the repository at this point in the history
If the cursor is warped during the destruction of the workspace, we end up in
the wrong position. Warp the cursor after arrange_workspace() so we end up in
the correct position.
  • Loading branch information
Emantor committed Oct 16, 2018
1 parent 4be412f commit 40ec9a3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion sway/tree/view.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,16 @@ void view_unmap(struct sway_view *view) {

struct sway_seat *seat;
wl_list_for_each(seat, &input_manager->seats, link) {
cursor_send_pointer_motion(seat->cursor, 0, true);
if (config->mouse_warping == WARP_CONTAINER) {
struct sway_node *node = seat_get_focus(seat);
if (node && node->type == N_CONTAINER) {
cursor_warp_to_container(seat->cursor, node->sway_container);
} else if (node && node->type == N_WORKSPACE) {
cursor_warp_to_workspace(seat->cursor, node->sway_workspace);
}
} else {
cursor_send_pointer_motion(seat->cursor, 0, true);
}
}

transaction_commit_dirty();
Expand Down

0 comments on commit 40ec9a3

Please sign in to comment.