aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/seat.c
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2018-04-08 11:34:38 -0400
committerLibravatar Tony Crisci <tony@dubstepdish.com>2018-04-08 11:34:38 -0400
commit46280460a58e6517b81e55eb0b027ad12aaed834 (patch)
tree82a91f3845733ec5540f368dc46dfbcacfa2bdf9 /sway/input/seat.c
parentcontainer_create_notify on split (diff)
downloadsway-46280460a58e6517b81e55eb0b027ad12aaed834.tar.gz
sway-46280460a58e6517b81e55eb0b027ad12aaed834.tar.zst
sway-46280460a58e6517b81e55eb0b027ad12aaed834.zip
push all parents of focused container in focus stack
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r--sway/input/seat.c15
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,
413 if (container) { 413 if (container) {
414 struct sway_seat_container *seat_con = 414 struct sway_seat_container *seat_con =
415 seat_container_from_container(seat, container); 415 seat_container_from_container(seat, container);
416 if (!seat_con) { 416 if (seat_con == NULL) {
417 return; 417 return;
418 } 418 }
419 419
420 // put all the anscestors of this container on top of the focus stack
421 struct sway_seat_container *parent =
422 seat_container_from_container(seat,
423 seat_con->container->parent);
424 while (parent) {
425 wl_list_remove(&parent->link);
426 wl_list_insert(&seat->focus_stack, &parent->link);
427
428 parent =
429 seat_container_from_container(seat,
430 parent->container->parent);
431 }
432
420 wl_list_remove(&seat_con->link); 433 wl_list_remove(&seat_con->link);
421 wl_list_insert(&seat->focus_stack, &seat_con->link); 434 wl_list_insert(&seat->focus_stack, &seat_con->link);
422 435