mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Fix invalid pointers when using resize grow width on first/last siblings
This commit is contained in:
		
							parent
							
								
									2024f1da72
								
							
						
					
					
						commit
						289130430f
					
				
					 1 changed files with 11 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -173,8 +173,17 @@ void container_resize_tiled(struct sway_container *con,
 | 
			
		|||
	int index = container_sibling_index(con);
 | 
			
		||||
 | 
			
		||||
	if (axis == AXIS_HORIZONTAL || axis == AXIS_VERTICAL) {
 | 
			
		||||
		if (index == 0) {
 | 
			
		||||
			next = siblings->items[1];
 | 
			
		||||
		} else if (index == siblings->length - 1) {
 | 
			
		||||
			// Convert edge to top/left
 | 
			
		||||
			next = con;
 | 
			
		||||
			con = siblings->items[index - 1];
 | 
			
		||||
			amount = -amount;
 | 
			
		||||
		} else {
 | 
			
		||||
			prev = siblings->items[index - 1];
 | 
			
		||||
			next = siblings->items[index + 1];
 | 
			
		||||
		}
 | 
			
		||||
	} else if (axis == WLR_EDGE_TOP || axis == WLR_EDGE_LEFT) {
 | 
			
		||||
		if (!sway_assert(index > 0, "Didn't expect first child")) {
 | 
			
		||||
			return;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue