aboutsummaryrefslogtreecommitdiff
path: root/sway/input/seat.c
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-05-20 09:11:55 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-05-21 20:16:56 +1000
commitefc07fb3d45e07529e3817b4a1598f2c3256d600 (patch)
tree28a76416b5d3a50fa4db1c459e19a3f42c849d35 /sway/input/seat.c
parentbd79584f659428df5d34f64f3b1cdb4c4388c3c6 (diff)
Don't track damage for views on inactive tabs
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r--sway/input/seat.c12
1 files changed, 12 insertions, 0 deletions
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;