mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Add sanity check for empty focus stack
This commit is contained in:
		
							parent
							
								
									54a835e962
								
							
						
					
					
						commit
						5dd535b67a
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -952,6 +952,9 @@ struct sway_node *seat_get_focus(struct sway_seat *seat) {
 | 
			
		|||
	if (!seat->has_focus) {
 | 
			
		||||
		return NULL;
 | 
			
		||||
	}
 | 
			
		||||
	if (wl_list_length(&seat->focus_stack) == 0) {
 | 
			
		||||
		return NULL;
 | 
			
		||||
	}
 | 
			
		||||
	struct sway_seat_node *current =
 | 
			
		||||
		wl_container_of(seat->focus_stack.next, current, link);
 | 
			
		||||
	return current->node;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue