mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	scene: schedule an output frame on wl_surface.frame
Some clients (e.g. mpv, Firefox) request a new wl_surface.frame
callback without damaging their surface. When this happens,
schedule a new output frame.
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3350
(cherry picked from commit 812951f5bc)
			
			
This commit is contained in:
		
							parent
							
								
									4b358c2f91
								
							
						
					
					
						commit
						df945b665c
					
				
					 1 changed files with 11 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -236,10 +236,6 @@ static void scene_surface_handle_surface_commit(struct wl_listener *listener,
 | 
			
		|||
		wl_container_of(listener, scene_surface, surface_commit);
 | 
			
		||||
	struct wlr_surface *surface = scene_surface->surface;
 | 
			
		||||
 | 
			
		||||
	if (!pixman_region32_not_empty(&surface->buffer_damage)) {
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	struct wlr_scene *scene = scene_node_get_root(&scene_surface->node);
 | 
			
		||||
 | 
			
		||||
	int lx, ly;
 | 
			
		||||
| 
						 | 
				
			
			@ -256,6 +252,17 @@ static void scene_surface_handle_surface_commit(struct wl_listener *listener,
 | 
			
		|||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// Even if the surface hasn't submitted damage, schedule a new frame if
 | 
			
		||||
	// the client has requested a wl_surface.frame callback.
 | 
			
		||||
	if (!wl_list_empty(&surface->current.frame_callback_list) &&
 | 
			
		||||
			scene_surface->primary_output != NULL) {
 | 
			
		||||
		wlr_output_schedule_frame(scene_surface->primary_output);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (!pixman_region32_not_empty(&surface->buffer_damage)) {
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	struct wlr_scene_output *scene_output;
 | 
			
		||||
	wl_list_for_each(scene_output, &scene->outputs, link) {
 | 
			
		||||
		struct wlr_output *output = scene_output->output;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue