aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorRouven Czerwinski <rouven@czerwinskis.de>2018-10-15 16:21:38 +0200
committerRouven Czerwinski <rouven@czerwinskis.de>2018-10-16 15:47:02 +0200
commit1f0aeae33591fb46b3f8a91ca91975daf2a8bbf9 (patch)
treefa0f67fd7479c06dd4a21b2ce15ec7d864bc5432 /sway
parentd69cf4c23c437b9ff724869f380e5c6cd03b091e (diff)
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.
Diffstat (limited to 'sway')
-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) {
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();