mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	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.
This commit is contained in:
		
							parent
							
								
									f611a4f9b1
								
							
						
					
					
						commit
						1e4807efa0
					
				
					 1 changed files with 6 additions and 6 deletions
				
			
		| 
						 | 
					@ -832,12 +832,12 @@ struct sway_container *seat_get_active_child(struct sway_seat *seat,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct sway_container *seat_get_active_current_child(struct sway_seat *seat,
 | 
					struct sway_container *seat_get_active_current_child(struct sway_seat *seat,
 | 
				
			||||||
		struct sway_container *container) {
 | 
							struct sway_container *container) {
 | 
				
			||||||
	struct sway_container *child = seat_get_active_child(seat, container);
 | 
						struct sway_seat_container *current = NULL;
 | 
				
			||||||
	if (child) {
 | 
						wl_list_for_each(current, &seat->focus_stack, link) {
 | 
				
			||||||
		return child;
 | 
							if (current->container->current.parent == container &&
 | 
				
			||||||
 | 
									current->container->current.layout != L_FLOATING) {
 | 
				
			||||||
 | 
								return current->container;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	if (container->current.children->length == 1) {
 | 
					 | 
				
			||||||
		return container->current.children->items[0];
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return NULL;
 | 
						return NULL;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue