mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	Add output_usable_area_scaled() helper
Preparatory for snap to window edge framework.
This commit is contained in:
		
							parent
							
								
									5eb769d6d6
								
							
						
					
					
						commit
						afe92654fd
					
				
					 2 changed files with 19 additions and 0 deletions
				
			
		
							
								
								
									
										18
									
								
								src/output.c
									
										
									
									
									
								
							
							
						
						
									
										18
									
								
								src/output.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -565,6 +565,24 @@ output_usable_area_in_layout_coords(struct output *output)
 | 
			
		|||
	return box;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
struct wlr_box
 | 
			
		||||
output_usable_area_scaled(struct output *output)
 | 
			
		||||
{
 | 
			
		||||
	if (!output) {
 | 
			
		||||
		return (struct wlr_box){0};
 | 
			
		||||
	}
 | 
			
		||||
	struct wlr_box usable = output_usable_area_in_layout_coords(output);
 | 
			
		||||
	if (usable.height == output->wlr_output->height
 | 
			
		||||
			&& output->wlr_output->scale != 1) {
 | 
			
		||||
		usable.height /= output->wlr_output->scale;
 | 
			
		||||
	}
 | 
			
		||||
	if (usable.width == output->wlr_output->width
 | 
			
		||||
			&& output->wlr_output->scale != 1) {
 | 
			
		||||
		usable.width /= output->wlr_output->scale;
 | 
			
		||||
	}
 | 
			
		||||
	return usable;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
handle_output_power_manager_set_mode(struct wl_listener *listener, void *data)
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue