aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-10-19 14:40:56 +0200
committerGitHub <noreply@github.com>2018-10-19 14:40:56 +0200
commit28f3b8cb038d54eeef5c6fe568b0ae360b59f96e (patch)
tree60a0dbb15a7ecc160bff46acec7aead1ca06ae54 /sway
parent96e3686ae882818edc35a14c207dfd97c40366d9 (diff)
parent4d743b64d0a8e15f79b0b71fd8b82bb044a6e82b (diff)
Merge pull request #2882 from RyanDwyer/fix-mouse-warp-logic
Fix logic used for mouse_warping output
Diffstat (limited to 'sway')
-rw-r--r--sway/input/seat.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 08b2e7cf..cffceaae 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -646,7 +646,6 @@ void seat_set_focus(struct sway_seat *seat, struct sway_node *node) {
}
struct sway_node *last_focus = seat_get_focus(seat);
- seat->prev_focus = last_focus;
if (last_focus == node) {
return;
}
@@ -1190,12 +1189,17 @@ void seat_pointer_notify_button(struct sway_seat *seat, uint32_t time_msec,
void seat_consider_warp_to_focus(struct sway_seat *seat) {
struct sway_node *focus = seat_get_focus(seat);
- if (config->mouse_warping == WARP_NO || !focus || !seat->prev_focus) {
+ if (config->mouse_warping == WARP_NO || !focus) {
return;
}
- if (config->mouse_warping == WARP_OUTPUT &&
- node_get_output(focus) == node_get_output(seat->prev_focus)) {
- return;
+ if (config->mouse_warping == WARP_OUTPUT) {
+ struct sway_output *output = node_get_output(focus);
+ struct wlr_box box;
+ output_get_box(output, &box);
+ if (wlr_box_contains_point(&box,
+ seat->cursor->cursor->x, seat->cursor->cursor->y)) {
+ return;
+ }
}
if (focus->type == N_CONTAINER) {