From efc07fb3d45e07529e3817b4a1598f2c3256d600 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sun, 20 May 2018 09:11:55 +1000 Subject: Don't track damage for views on inactive tabs --- sway/input/seat.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'sway/input/seat.c') diff --git a/sway/input/seat.c b/sway/input/seat.c index 7d541f6e..7a3e928a 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c @@ -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; -- cgit v1.2.3