aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/seat.c
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2018-04-07 16:14:12 -0400
committerLibravatar Tony Crisci <tony@dubstepdish.com>2018-04-07 16:14:12 -0400
commitde811823b60cc33fb6a65c6f1045e9d1fb497243 (patch)
treeb8ef5b4e6da520708a199524d0d5bb40974b67ee /sway/input/seat.c
parentseat get focus inactive view (diff)
downloadsway-de811823b60cc33fb6a65c6f1045e9d1fb497243.tar.gz
sway-de811823b60cc33fb6a65c6f1045e9d1fb497243.tar.zst
sway-de811823b60cc33fb6a65c6f1045e9d1fb497243.zip
seat focus inactive children foreach
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r--sway/input/seat.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 1a646715..3656d6b6 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -106,6 +106,20 @@ static struct sway_container *seat_get_focus_by_type(struct sway_seat *seat,
106 return NULL; 106 return NULL;
107} 107}
108 108
109void seat_focus_inactive_children_for_each(struct sway_seat *seat,
110 struct sway_container *container,
111 void (*f)(struct sway_container *container, void *data), void *data) {
112 struct sway_seat_container *current = NULL;
113 wl_list_for_each(current, &seat->focus_stack, link) {
114 if (current->container->parent == NULL) {
115 continue;
116 }
117 if (current->container->parent == container) {
118 f(current->container, data);
119 }
120 }
121}
122
109struct sway_container *seat_get_focus_inactive_view(struct sway_seat *seat, 123struct sway_container *seat_get_focus_inactive_view(struct sway_seat *seat,
110 struct sway_container *container) { 124 struct sway_container *container) {
111 return seat_get_focus_by_type(seat, container, C_VIEW); 125 return seat_get_focus_by_type(seat, container, C_VIEW);