summaryrefslogtreecommitdiffstats
path: root/sway/input/seat.c
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2018-05-23 22:54:52 +0100
committerLibravatar emersion <contact@emersion.fr>2018-05-23 22:54:52 +0100
commitcd0fca2ebf81c252b3743c4474a5fdbcd3e2afad (patch)
tree595f1e80551b64de0d4e24f5721bae27acc195d9 /sway/input/seat.c
parentFix output hotplugging (diff)
parentMerge pull request #2022 from RedSoxFan/ipc-get-marks (diff)
downloadsway-cd0fca2ebf81c252b3743c4474a5fdbcd3e2afad.tar.gz
sway-cd0fca2ebf81c252b3743c4474a5fdbcd3e2afad.tar.zst
sway-cd0fca2ebf81c252b3743c4474a5fdbcd3e2afad.zip
Merge branch 'master' into fix-swaylock-hotplugging
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r--sway/input/seat.c16
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
721struct 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
721struct sway_container *sway_seat_get_focus(struct sway_seat *seat) { 733struct 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;