aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-07-02 22:16:20 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-07-02 22:16:20 +1000
commit1e4807efa0647b2d856a4c8e9b23aff35625d1d8 (patch)
treee55ab7e10800cf73fca0d9e49911fa58fb8db420
parentMerge pull request #2187 from martinetd/idle-inhibit (diff)
downloadsway-1e4807efa0647b2d856a4c8e9b23aff35625d1d8.tar.gz
sway-1e4807efa0647b2d856a4c8e9b23aff35625d1d8.tar.zst
sway-1e4807efa0647b2d856a4c8e9b23aff35625d1d8.zip
Don't return pending children in seat_get_active_current_child
Fixes #2192. seat_get_active_current_child is intended to return a child of the given container which has finished its mapping transaction and is able to be rendered on screen. The previous implementation was capable of returning a pending child, which caused a child of a tabbed or stacked view to be rendered prematurely while it was mapping.
-rw-r--r--sway/input/seat.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 2c2087da..a934d4a8 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -832,12 +832,12 @@ struct sway_container *seat_get_active_child(struct sway_seat *seat,
832 832
833struct sway_container *seat_get_active_current_child(struct sway_seat *seat, 833struct sway_container *seat_get_active_current_child(struct sway_seat *seat,
834 struct sway_container *container) { 834 struct sway_container *container) {
835 struct sway_container *child = seat_get_active_child(seat, container); 835 struct sway_seat_container *current = NULL;
836 if (child) { 836 wl_list_for_each(current, &seat->focus_stack, link) {
837 return child; 837 if (current->container->current.parent == container &&
838 } 838 current->container->current.layout != L_FLOATING) {
839 if (container->current.children->length == 1) { 839 return current->container;
840 return container->current.children->items[0]; 840 }
841 } 841 }
842 return NULL; 842 return NULL;
843} 843}