mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	fix output rendering issue
This commit is contained in:
		
							parent
							
								
									7c089442c3
								
							
						
					
					
						commit
						80927985fb
					
				
					 1 changed files with 12 additions and 8 deletions
				
			
		| 
						 | 
					@ -46,18 +46,22 @@ static void render_surface(struct wlr_surface *surface,
 | 
				
			||||||
	int height = surface->current->height;
 | 
						int height = surface->current->height;
 | 
				
			||||||
	int render_width = width * wlr_output->scale;
 | 
						int render_width = width * wlr_output->scale;
 | 
				
			||||||
	int render_height = height * wlr_output->scale;
 | 
						int render_height = height * wlr_output->scale;
 | 
				
			||||||
	double ox = lx, oy = ly;
 | 
						int owidth, oheight;
 | 
				
			||||||
	wlr_output_layout_output_coords(layout, wlr_output, &ox, &oy);
 | 
						wlr_output_effective_resolution(wlr_output, &owidth, &oheight);
 | 
				
			||||||
	ox *= wlr_output->scale;
 | 
					 | 
				
			||||||
	oy *= wlr_output->scale;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	struct wlr_box render_box = {
 | 
						// FIXME: view coords are inconsistently assumed to be in output or layout coords
 | 
				
			||||||
		.x = lx, .y = ly,
 | 
						struct wlr_box layout_box = {
 | 
				
			||||||
 | 
							.x = lx + owidth, .y = ly + oheight,
 | 
				
			||||||
		.width = render_width, .height = render_height,
 | 
							.width = render_width, .height = render_height,
 | 
				
			||||||
	};
 | 
						};
 | 
				
			||||||
	if (wlr_output_layout_intersects(layout, wlr_output, &render_box)) {
 | 
						if (wlr_output_layout_intersects(layout, wlr_output, &layout_box)) {
 | 
				
			||||||
 | 
							struct wlr_box render_box = {
 | 
				
			||||||
 | 
								.x = lx, .y = ly,
 | 
				
			||||||
 | 
								.width = render_width, .height = render_height
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
		float matrix[16];
 | 
							float matrix[16];
 | 
				
			||||||
		wlr_matrix_project_box(&matrix, &render_box, surface->current->transform, 0, &wlr_output->transform_matrix);
 | 
							wlr_matrix_project_box(&matrix, &render_box,
 | 
				
			||||||
 | 
									surface->current->transform, 0, &wlr_output->transform_matrix);
 | 
				
			||||||
		wlr_render_with_matrix(server.renderer, surface->texture,
 | 
							wlr_render_with_matrix(server.renderer, surface->texture,
 | 
				
			||||||
			&matrix);
 | 
								&matrix);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue