summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Rouven Czerwinski <rouven@czerwinskis.de>2018-10-15 16:21:38 +0200
committerLibravatar Rouven Czerwinski <rouven@czerwinskis.de>2018-10-16 15:47:02 +0200
commit1f0aeae33591fb46b3f8a91ca91975daf2a8bbf9 (patch)
treefa0f67fd7479c06dd4a21b2ce15ec7d864bc5432
parentseat: use new warping functions for cursor warping during focus warp (diff)
downloadsway-1f0aeae33591fb46b3f8a91ca91975daf2a8bbf9.tar.gz
sway-1f0aeae33591fb46b3f8a91ca91975daf2a8bbf9.tar.zst
sway-1f0aeae33591fb46b3f8a91ca91975daf2a8bbf9.zip
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.
-rw-r--r--sway/tree/view.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index bdd5f830..4b9bbfd0 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -637,7 +637,16 @@ void view_unmap(struct sway_view *view) {
637 637
638 struct sway_seat *seat; 638 struct sway_seat *seat;
639 wl_list_for_each(seat, &input_manager->seats, link) { 639 wl_list_for_each(seat, &input_manager->seats, link) {
640 cursor_send_pointer_motion(seat->cursor, 0, true); 640 if (config->mouse_warping == WARP_CONTAINER) {
641 struct sway_node *node = seat_get_focus(seat);
642 if (node && node->type == N_CONTAINER) {
643 cursor_warp_to_container(seat->cursor, node->sway_container);
644 } else if (node && node->type == N_WORKSPACE) {
645 cursor_warp_to_workspace(seat->cursor, node->sway_workspace);
646 }
647 } else {
648 cursor_send_pointer_motion(seat->cursor, 0, true);
649 }
641 } 650 }
642 651
643 transaction_commit_dirty(); 652 transaction_commit_dirty();