view: rewarp cursor during view_unmap

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.
master
Rouven Czerwinski 6 years ago
parent d69cf4c23c
commit 1f0aeae335

@ -637,8 +637,17 @@ void view_unmap(struct sway_view *view) {
struct sway_seat *seat; struct sway_seat *seat;
wl_list_for_each(seat, &input_manager->seats, link) { wl_list_for_each(seat, &input_manager->seats, link) {
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); cursor_send_pointer_motion(seat->cursor, 0, true);
} }
}
transaction_commit_dirty(); transaction_commit_dirty();
view->surface = NULL; view->surface = NULL;

Loading…
Cancel
Save