aboutsummaryrefslogtreecommitdiff
path: root/sway/input
diff options
context:
space:
mode:
Diffstat (limited to 'sway/input')
-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 1ea36466..436d18e2 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -829,6 +829,18 @@ struct sway_container *seat_get_active_child(struct sway_seat *seat,
return NULL;
}
+struct sway_container *seat_get_active_current_child(struct sway_seat *seat,
+ struct sway_container *container) {
+ struct sway_container *child = seat_get_active_child(seat, container);
+ if (child) {
+ return child;
+ }
+ if (container->current.children->length == 1) {
+ return container->current.children->items[0];
+ }
+ return NULL;
+}
+
struct sway_container *seat_get_focus(struct sway_seat *seat) {
if (!seat->has_focus) {
return NULL;