mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Null check sway_layer_surface when checking damage
Before this change, an overlay layer-shell surface without a buffer attached would segfault the compositor on screen damage.
This commit is contained in:
		
							parent
							
								
									fafc060909
								
							
						
					
					
						commit
						91c0ffd6cf
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		| 
						 | 
					@ -388,6 +388,9 @@ bool output_has_opaque_overlay_layer_surface(struct sway_output *output) {
 | 
				
			||||||
		struct wlr_surface *wlr_surface = wlr_layer_surface_v1->surface;
 | 
							struct wlr_surface *wlr_surface = wlr_layer_surface_v1->surface;
 | 
				
			||||||
		struct sway_layer_surface *sway_layer_surface =
 | 
							struct sway_layer_surface *sway_layer_surface =
 | 
				
			||||||
			layer_from_wlr_layer_surface_v1(wlr_layer_surface_v1);
 | 
								layer_from_wlr_layer_surface_v1(wlr_layer_surface_v1);
 | 
				
			||||||
 | 
							if (sway_layer_surface == NULL) {
 | 
				
			||||||
 | 
								continue;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		pixman_box32_t output_box = {
 | 
							pixman_box32_t output_box = {
 | 
				
			||||||
			.x2 = output->width,
 | 
								.x2 = output->width,
 | 
				
			||||||
			.y2 = output->height,
 | 
								.y2 = output->height,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue