mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-10-29 05:40:12 -04:00 
			
		
		
		
	wlr_output_layout_contains_point: handle outputs that aren't in the layout
Instead of crashing, return `false` when the specified output isn't part of the layout, as we can be sure that it doesn't contain the specified point.
This commit is contained in:
		
							parent
							
								
									2dd121235e
								
							
						
					
					
						commit
						13fcdba75c
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		|  | @ -231,6 +231,9 @@ bool wlr_output_layout_contains_point(struct wlr_output_layout *layout, | |||
| 	if (reference) { | ||||
| 		struct wlr_output_layout_output *l_output = | ||||
| 			wlr_output_layout_get(layout, reference); | ||||
| 		if (!l_output) { | ||||
| 			return false; | ||||
| 		} | ||||
| 		struct wlr_box output_box; | ||||
| 		output_layout_output_get_box(l_output, &output_box); | ||||
| 		return wlr_box_contains_point(&output_box, lx, ly); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Sebastian Krzyszkowiak
						Sebastian Krzyszkowiak