diff options
author | Tony Crisci <tony@dubstepdish.com> | 2018-04-08 11:34:38 -0400 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2018-04-08 11:34:38 -0400 |
commit | 46280460a58e6517b81e55eb0b027ad12aaed834 (patch) | |
tree | 82a91f3845733ec5540f368dc46dfbcacfa2bdf9 /sway | |
parent | 9db859585e79d468ff79f41db6bc0950fb285a5a (diff) | |
download | sway-46280460a58e6517b81e55eb0b027ad12aaed834.tar.xz |
push all parents of focused container in focus stack
Diffstat (limited to 'sway')
-rw-r--r-- | sway/input/seat.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index 3656d6b6..9f44955c 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c @@ -413,10 +413,23 @@ void seat_set_focus_warp(struct sway_seat *seat, if (container) { struct sway_seat_container *seat_con = seat_container_from_container(seat, container); - if (!seat_con) { + if (seat_con == NULL) { return; } + // put all the anscestors of this container on top of the focus stack + struct sway_seat_container *parent = + seat_container_from_container(seat, + seat_con->container->parent); + while (parent) { + wl_list_remove(&parent->link); + wl_list_insert(&seat->focus_stack, &parent->link); + + parent = + seat_container_from_container(seat, + parent->container->parent); + } + wl_list_remove(&seat_con->link); wl_list_insert(&seat->focus_stack, &seat_con->link); |