mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Fix crash when flattening container after moving
container_flatten removes the container from the tree (via container_replace) before destroying it. When destroying, the recent changes to handle_seat_node_destroy incorrectly assumes that the container has a parent. This adds a check for destroying a container which is no longer in the tree. If this is the case, focus does not need to be changed.
This commit is contained in:
		
							parent
							
								
									c8d1f376d3
								
							
						
					
					
						commit
						44b550298e
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		| 
						 | 
					@ -157,6 +157,11 @@ static void handle_seat_node_destroy(struct wl_listener *listener, void *data) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	seat_node_destroy(seat_node);
 | 
						seat_node_destroy(seat_node);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (!parent) {
 | 
				
			||||||
 | 
							// Destroying a container that is no longer in the tree
 | 
				
			||||||
 | 
							return;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Find new focus_inactive (ie. sibling, or workspace if no siblings left)
 | 
						// Find new focus_inactive (ie. sibling, or workspace if no siblings left)
 | 
				
			||||||
	struct sway_node *next_focus = NULL;
 | 
						struct sway_node *next_focus = NULL;
 | 
				
			||||||
	while (next_focus == NULL) {
 | 
						while (next_focus == NULL) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue