diff options
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, | |||
602 | wlr_output, seat->cursor->cursor->x, | 602 | wlr_output, seat->cursor->cursor->x, |
603 | seat->cursor->cursor->y)) { | 603 | seat->cursor->cursor->y)) { |
604 | wlr_cursor_warp(seat->cursor->cursor, NULL, x, y); | 604 | wlr_cursor_warp(seat->cursor->cursor, NULL, x, y); |
605 | cursor_send_pointer_motion(seat->cursor, 0); | 605 | cursor_send_pointer_motion(seat->cursor, 0, true); |
606 | } | 606 | } |
607 | } | 607 | } |
608 | } | 608 | } |
@@ -613,7 +613,7 @@ void seat_set_focus_warp(struct sway_seat *seat, | |||
613 | } | 613 | } |
614 | 614 | ||
615 | if (last_workspace && last_workspace != new_workspace) { | 615 | if (last_workspace && last_workspace != new_workspace) { |
616 | cursor_send_pointer_motion(seat->cursor, 0); | 616 | cursor_send_pointer_motion(seat->cursor, 0, true); |
617 | } | 617 | } |
618 | 618 | ||
619 | seat->has_focus = (container != NULL); | 619 | seat->has_focus = (container != NULL); |
@@ -718,6 +718,18 @@ struct sway_container *seat_get_focus_inactive(struct sway_seat *seat, | |||
718 | return seat_get_focus_by_type(seat, container, C_TYPES); | 718 | return seat_get_focus_by_type(seat, container, C_TYPES); |
719 | } | 719 | } |
720 | 720 | ||
721 | struct sway_container *seat_get_active_child(struct sway_seat *seat, | ||
722 | struct sway_container *container) { | ||
723 | struct sway_container *focus = seat_get_focus_inactive(seat, container); | ||
724 | if (!focus) { | ||
725 | return NULL; | ||
726 | } | ||
727 | while (focus->parent != container) { | ||
728 | focus = focus->parent; | ||
729 | } | ||
730 | return focus; | ||
731 | } | ||
732 | |||
721 | struct sway_container *sway_seat_get_focus(struct sway_seat *seat) { | 733 | struct sway_container *sway_seat_get_focus(struct sway_seat *seat) { |
722 | if (!seat->has_focus) { | 734 | if (!seat->has_focus) { |
723 | return NULL; | 735 | return NULL; |