mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Translate surface by its geo when doing opaque box check
This commit is contained in:
		
							parent
							
								
									9480781229
								
							
						
					
					
						commit
						464d4d5889
					
				
					 1 changed files with 11 additions and 2 deletions
				
			
		| 
						 | 
					@ -930,12 +930,21 @@ bool output_has_opaque_lockscreen(struct sway_output *output,
 | 
				
			||||||
		if (wlr_surface->resource->client != seat->exclusive_client) {
 | 
							if (wlr_surface->resource->client != seat->exclusive_client) {
 | 
				
			||||||
			continue;
 | 
								continue;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							struct sway_layer_surface *sway_layer_surface =
 | 
				
			||||||
 | 
								layer_from_wlr_layer_surface(wlr_layer_surface);
 | 
				
			||||||
		pixman_box32_t output_box = {
 | 
							pixman_box32_t output_box = {
 | 
				
			||||||
			.x2 = output->swayc->current.swayc_width,
 | 
								.x2 = output->swayc->current.swayc_width,
 | 
				
			||||||
			.y2 = output->swayc->current.swayc_height,
 | 
								.y2 = output->swayc->current.swayc_height,
 | 
				
			||||||
		};
 | 
							};
 | 
				
			||||||
		if (pixman_region32_contains_rectangle(&wlr_surface->current.opaque,
 | 
							pixman_region32_t surface_opaque_box;
 | 
				
			||||||
					&output_box)) {
 | 
							pixman_region32_init(&surface_opaque_box);
 | 
				
			||||||
 | 
							pixman_region32_copy(&surface_opaque_box, &wlr_surface->current.opaque);
 | 
				
			||||||
 | 
							pixman_region32_translate(&surface_opaque_box,
 | 
				
			||||||
 | 
									sway_layer_surface->geo.x, sway_layer_surface->geo.y);
 | 
				
			||||||
 | 
							bool contains = pixman_region32_contains_rectangle(
 | 
				
			||||||
 | 
									&wlr_surface->current.opaque, &output_box);
 | 
				
			||||||
 | 
							pixman_region32_fini(&surface_opaque_box);
 | 
				
			||||||
 | 
							if (contains) {
 | 
				
			||||||
			return true;
 | 
								return true;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue