mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	view: let view_set_fallback_natural_geometry() return wlr_box
				
					
				
			This commit is contained in:
		
							parent
							
								
									164b17c279
								
							
						
					
					
						commit
						e6b5d91b63
					
				
					 3 changed files with 11 additions and 11 deletions
				
			
		
							
								
								
									
										18
									
								
								src/view.c
									
										
									
									
									
								
							
							
						
						
									
										18
									
								
								src/view.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -953,16 +953,16 @@ adjust_floating_geometry(struct view *view, struct wlr_box *geometry,
 | 
			
		|||
		&geometry->x, &geometry->y);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
view_set_fallback_natural_geometry(struct view *view)
 | 
			
		||||
struct wlr_box
 | 
			
		||||
view_get_fallback_natural_geometry(struct view *view)
 | 
			
		||||
{
 | 
			
		||||
	view->natural_geometry.width = VIEW_FALLBACK_WIDTH;
 | 
			
		||||
	view->natural_geometry.height = VIEW_FALLBACK_HEIGHT;
 | 
			
		||||
	struct wlr_box box = {
 | 
			
		||||
		.width = VIEW_FALLBACK_WIDTH,
 | 
			
		||||
		.height = VIEW_FALLBACK_HEIGHT,
 | 
			
		||||
	};
 | 
			
		||||
	view_compute_centered_position(view, NULL,
 | 
			
		||||
		view->natural_geometry.width,
 | 
			
		||||
		view->natural_geometry.height,
 | 
			
		||||
		&view->natural_geometry.x,
 | 
			
		||||
		&view->natural_geometry.y);
 | 
			
		||||
		box.width, box.height, &box.x, &box.y);
 | 
			
		||||
	return box;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
| 
						 | 
				
			
			@ -1502,7 +1502,7 @@ view_maximize(struct view *view, enum view_axis axis,
 | 
			
		|||
	 */
 | 
			
		||||
	if ((axis == VIEW_AXIS_HORIZONTAL || axis == VIEW_AXIS_VERTICAL)
 | 
			
		||||
			&& wlr_box_empty(&view->natural_geometry)) {
 | 
			
		||||
		view_set_fallback_natural_geometry(view);
 | 
			
		||||
		view->natural_geometry = view_get_fallback_natural_geometry(view);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	set_maximized(view, axis);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue