diff options
author | emersion <contact@emersion.fr> | 2018-05-23 22:54:52 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-05-23 22:54:52 +0100 |
commit | cd0fca2ebf81c252b3743c4474a5fdbcd3e2afad (patch) | |
tree | 595f1e80551b64de0d4e24f5721bae27acc195d9 /sway/input/seat.c | |
parent | b7ab7c0e66433aacaaccce08d6e40304e6f6593c (diff) | |
parent | 12a12878b9883c345dd73752a9cf714aeb245b8a (diff) |
Merge branch 'master' into fix-swaylock-hotplugging
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r-- | sway/input/seat.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index 9ac3e6a8..7a3e928a 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c @@ -602,7 +602,7 @@ void seat_set_focus_warp(struct sway_seat *seat, wlr_output, seat->cursor->cursor->x, seat->cursor->cursor->y)) { wlr_cursor_warp(seat->cursor->cursor, NULL, x, y); - cursor_send_pointer_motion(seat->cursor, 0); + cursor_send_pointer_motion(seat->cursor, 0, true); } } } @@ -613,7 +613,7 @@ void seat_set_focus_warp(struct sway_seat *seat, } if (last_workspace && last_workspace != new_workspace) { - cursor_send_pointer_motion(seat->cursor, 0); + cursor_send_pointer_motion(seat->cursor, 0, true); } seat->has_focus = (container != NULL); @@ -718,6 +718,18 @@ struct sway_container *seat_get_focus_inactive(struct sway_seat *seat, return seat_get_focus_by_type(seat, container, C_TYPES); } +struct sway_container *seat_get_active_child(struct sway_seat *seat, + struct sway_container *container) { + struct sway_container *focus = seat_get_focus_inactive(seat, container); + if (!focus) { + return NULL; + } + while (focus->parent != container) { + focus = focus->parent; + } + return focus; +} + struct sway_container *sway_seat_get_focus(struct sway_seat *seat) { if (!seat->has_focus) { return NULL; |