mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Merge pull request #2099 from RyanDwyer/fix-seat-get-active-child
Fix seat_get_active_child
This commit is contained in:
		
						commit
						6d0ad6a1ed
					
				
					 1 changed files with 7 additions and 7 deletions
				
			
		| 
						 | 
					@ -728,14 +728,14 @@ struct sway_container *seat_get_focus_inactive(struct sway_seat *seat,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct sway_container *seat_get_active_child(struct sway_seat *seat,
 | 
					struct sway_container *seat_get_active_child(struct sway_seat *seat,
 | 
				
			||||||
		struct sway_container *container) {
 | 
							struct sway_container *container) {
 | 
				
			||||||
	struct sway_container *focus = seat_get_focus_inactive(seat, container);
 | 
						struct sway_seat_container *current = NULL;
 | 
				
			||||||
	if (!focus) {
 | 
						wl_list_for_each(current, &seat->focus_stack, link) {
 | 
				
			||||||
 | 
							if (current->container->parent == container &&
 | 
				
			||||||
 | 
									current->container->layout != L_FLOATING) {
 | 
				
			||||||
 | 
								return current->container;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	return NULL;
 | 
						return NULL;
 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	while (focus->parent != container) {
 | 
					 | 
				
			||||||
		focus = focus->parent;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	return focus;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct sway_container *seat_get_focus(struct sway_seat *seat) {
 | 
					struct sway_container *seat_get_focus(struct sway_seat *seat) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue