diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-10-10 14:06:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-10 14:06:14 +0200 |
commit | 782ed19bc30378126f44272c1e46f2a05a9b2db1 (patch) | |
tree | ad2feecb17cadccf71468d4f6b22d2ad6cf27d00 /sway/input/seat.c | |
parent | 155e863ead0edca244e4c961ca80418edde81838 (diff) | |
parent | ed33d95b6ae8a2d231cdda554f364af7211c2527 (diff) |
Merge pull request #2814 from Emantor/mouse-warping-container
Add mouse_warping container
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r-- | sway/input/seat.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index daf5b160..03ed638e 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c @@ -772,7 +772,9 @@ void seat_set_focus_warp(struct sway_seat *seat, struct sway_node *node, } if (last_focus) { - if (config->mouse_warping && warp && new_output != last_output) { + if (config->mouse_warping && warp && + (new_output != last_output || + config->mouse_warping == WARP_CONTAINER)) { double x = 0; double y = 0; if (container) { @@ -782,9 +784,11 @@ void seat_set_focus_warp(struct sway_seat *seat, struct sway_node *node, x = new_workspace->x + new_workspace->width / 2.0; y = new_workspace->y + new_workspace->height / 2.0; } + if (!wlr_output_layout_contains_point(root->output_layout, new_output->wlr_output, seat->cursor->cursor->x, - seat->cursor->cursor->y)) { + 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); } |