mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Updates per wlroots#1076
This commit is contained in:
		
							parent
							
								
									dd869c158e
								
							
						
					
					
						commit
						d43500831a
					
				
					 5 changed files with 16 additions and 16 deletions
				
			
		| 
						 | 
					@ -81,8 +81,8 @@ static bool get_surface_box(struct root_geometry *geo,
 | 
				
			||||||
		return false;
 | 
							return false;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	int sw = surface->current->width;
 | 
						int sw = surface->current.width;
 | 
				
			||||||
	int sh = surface->current->height;
 | 
						int sh = surface->current.height;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	double _sx = sx, _sy = sy;
 | 
						double _sx = sx, _sy = sy;
 | 
				
			||||||
	rotate_child_position(&_sx, &_sy, sw, sh, geo->width, geo->height,
 | 
						rotate_child_position(&_sx, &_sy, sw, sh, geo->width, geo->height,
 | 
				
			||||||
| 
						 | 
					@ -115,8 +115,8 @@ static void surface_for_each_surface(struct wlr_surface *surface,
 | 
				
			||||||
		wlr_surface_iterator_func_t iterator, void *user_data) {
 | 
							wlr_surface_iterator_func_t iterator, void *user_data) {
 | 
				
			||||||
	geo->x = ox;
 | 
						geo->x = ox;
 | 
				
			||||||
	geo->y = oy;
 | 
						geo->y = oy;
 | 
				
			||||||
	geo->width = surface->current->width;
 | 
						geo->width = surface->current.width;
 | 
				
			||||||
	geo->height = surface->current->height;
 | 
						geo->height = surface->current.height;
 | 
				
			||||||
	geo->rotation = 0;
 | 
						geo->rotation = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	wlr_surface_for_each_surface(surface, iterator, user_data);
 | 
						wlr_surface_for_each_surface(surface, iterator, user_data);
 | 
				
			||||||
| 
						 | 
					@ -258,7 +258,7 @@ static void render_surface_iterator(struct wlr_surface *surface, int sx, int sy,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	float matrix[9];
 | 
						float matrix[9];
 | 
				
			||||||
	enum wl_output_transform transform =
 | 
						enum wl_output_transform transform =
 | 
				
			||||||
		wlr_output_transform_invert(surface->current->transform);
 | 
							wlr_output_transform_invert(surface->current.transform);
 | 
				
			||||||
	wlr_matrix_project_box(matrix, &box, transform, rotation,
 | 
						wlr_matrix_project_box(matrix, &box, transform, rotation,
 | 
				
			||||||
		wlr_output->transform_matrix);
 | 
							wlr_output->transform_matrix);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1163,16 +1163,16 @@ 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)) {
 | 
						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);
 | 
				
			||||||
		wlr_region_scale(&damage, &damage, output->wlr_output->scale);
 | 
							wlr_region_scale(&damage, &damage, output->wlr_output->scale);
 | 
				
			||||||
		if (ceil(output->wlr_output->scale) > surface->current->scale) {
 | 
							if (ceil(output->wlr_output->scale) > surface->current.scale) {
 | 
				
			||||||
			// When scaling up a surface, it'll become blurry so we need to
 | 
								// When scaling up a surface, it'll become blurry so we need to
 | 
				
			||||||
			// expand the damage region
 | 
								// expand the damage region
 | 
				
			||||||
			wlr_region_expand(&damage, &damage,
 | 
								wlr_region_expand(&damage, &damage,
 | 
				
			||||||
				ceil(output->wlr_output->scale) - surface->current->scale);
 | 
									ceil(output->wlr_output->scale) - surface->current.scale);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		pixman_region32_translate(&damage, box.x, box.y);
 | 
							pixman_region32_translate(&damage, box.x, box.y);
 | 
				
			||||||
		wlr_region_rotated_bounds(&damage, &damage, rotation,
 | 
							wlr_region_rotated_bounds(&damage, &damage, rotation,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -73,8 +73,8 @@ static void save_view_buffer(struct sway_view *view,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (view->surface && wlr_surface_has_buffer(view->surface)) {
 | 
						if (view->surface && wlr_surface_has_buffer(view->surface)) {
 | 
				
			||||||
		instruction->saved_buffer = wlr_buffer_ref(view->surface->buffer);
 | 
							instruction->saved_buffer = wlr_buffer_ref(view->surface->buffer);
 | 
				
			||||||
		instruction->saved_buffer_width = view->surface->current->width;
 | 
							instruction->saved_buffer_width = view->surface->current.width;
 | 
				
			||||||
		instruction->saved_buffer_height = view->surface->current->height;
 | 
							instruction->saved_buffer_height = view->surface->current.height;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -251,8 +251,8 @@ static void handle_map(struct wl_listener *listener, void *data) {
 | 
				
			||||||
	view->natural_width = view->wlr_xdg_surface->geometry.width;
 | 
						view->natural_width = view->wlr_xdg_surface->geometry.width;
 | 
				
			||||||
	view->natural_height = view->wlr_xdg_surface->geometry.height;
 | 
						view->natural_height = view->wlr_xdg_surface->geometry.height;
 | 
				
			||||||
	if (!view->natural_width && !view->natural_height) {
 | 
						if (!view->natural_width && !view->natural_height) {
 | 
				
			||||||
		view->natural_width = view->wlr_xdg_surface->surface->current->width;
 | 
							view->natural_width = view->wlr_xdg_surface->surface->current.width;
 | 
				
			||||||
		view->natural_height = view->wlr_xdg_surface->surface->current->height;
 | 
							view->natural_height = view->wlr_xdg_surface->surface->current.height;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	view_map(view, view->wlr_xdg_surface->surface);
 | 
						view_map(view, view->wlr_xdg_surface->surface);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -246,8 +246,8 @@ static void handle_map(struct wl_listener *listener, void *data) {
 | 
				
			||||||
	view->natural_width = view->wlr_xdg_surface_v6->geometry.width;
 | 
						view->natural_width = view->wlr_xdg_surface_v6->geometry.width;
 | 
				
			||||||
	view->natural_height = view->wlr_xdg_surface_v6->geometry.height;
 | 
						view->natural_height = view->wlr_xdg_surface_v6->geometry.height;
 | 
				
			||||||
	if (!view->natural_width && !view->natural_height) {
 | 
						if (!view->natural_width && !view->natural_height) {
 | 
				
			||||||
		view->natural_width = view->wlr_xdg_surface_v6->surface->current->width;
 | 
							view->natural_width = view->wlr_xdg_surface_v6->surface->current.width;
 | 
				
			||||||
		view->natural_height = view->wlr_xdg_surface_v6->surface->current->height;
 | 
							view->natural_height = view->wlr_xdg_surface_v6->surface->current.height;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	view_map(view, view->wlr_xdg_surface_v6->surface);
 | 
						view_map(view, view->wlr_xdg_surface_v6->surface);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -278,7 +278,7 @@ static void handle_commit(struct wl_listener *listener, void *data) {
 | 
				
			||||||
		wl_container_of(listener, xwayland_view, commit);
 | 
							wl_container_of(listener, xwayland_view, commit);
 | 
				
			||||||
	struct sway_view *view = &xwayland_view->view;
 | 
						struct sway_view *view = &xwayland_view->view;
 | 
				
			||||||
	struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface;
 | 
						struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface;
 | 
				
			||||||
	struct wlr_surface_state *surface_state = xsurface->surface->current;
 | 
						struct wlr_surface_state *surface_state = &xsurface->surface->current;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (view->swayc->instructions->length) {
 | 
						if (view->swayc->instructions->length) {
 | 
				
			||||||
		transaction_notify_view_ready_by_size(view,
 | 
							transaction_notify_view_ready_by_size(view,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue