mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Only send frame done to visible views
Also don't accumulate empty damage
This commit is contained in:
		
							parent
							
								
									2d480e754e
								
							
						
					
					
						commit
						65845be802
					
				
					 1 changed files with 21 additions and 14 deletions
				
			
		| 
						 | 
					@ -948,6 +948,11 @@ static void send_frame_done_container_iterator(struct sway_container *con,
 | 
				
			||||||
	if (!sway_assert(con->type == C_VIEW, "expected a view")) {
 | 
						if (!sway_assert(con->type == C_VIEW, "expected a view")) {
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (!view_is_visible(con->sway_view)) {
 | 
				
			||||||
 | 
							return;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	output_view_for_each_surface(con->sway_view, &data->root_geo,
 | 
						output_view_for_each_surface(con->sway_view, &data->root_geo,
 | 
				
			||||||
		send_frame_done_iterator, data);
 | 
							send_frame_done_iterator, data);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -1039,6 +1044,7 @@ static void damage_surface_iterator(struct wlr_surface *surface, int sx, int sy,
 | 
				
			||||||
	int center_x = box.x + box.width/2;
 | 
						int center_x = box.x + box.width/2;
 | 
				
			||||||
	int center_y = box.y + box.height/2;
 | 
						int center_y = box.y + box.height/2;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (pixman_region32_not_empty(&surface->current->surface_damage)) {
 | 
				
			||||||
		pixman_region32_t damage;
 | 
							pixman_region32_t damage;
 | 
				
			||||||
		pixman_region32_init(&damage);
 | 
							pixman_region32_init(&damage);
 | 
				
			||||||
		pixman_region32_copy(&damage, &surface->current->surface_damage);
 | 
							pixman_region32_copy(&damage, &surface->current->surface_damage);
 | 
				
			||||||
| 
						 | 
					@ -1054,6 +1060,7 @@ static void damage_surface_iterator(struct wlr_surface *surface, int sx, int sy,
 | 
				
			||||||
			center_x, center_y);
 | 
								center_x, center_y);
 | 
				
			||||||
		wlr_output_damage_add(output->damage, &damage);
 | 
							wlr_output_damage_add(output->damage, &damage);
 | 
				
			||||||
		pixman_region32_fini(&damage);
 | 
							pixman_region32_fini(&damage);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (whole) {
 | 
						if (whole) {
 | 
				
			||||||
		wlr_box_rotated_bounds(&box, rotation, &box);
 | 
							wlr_box_rotated_bounds(&box, rotation, &box);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue