Remove rootston surface iterator
This commit is contained in:
		
							parent
							
								
									4a9a9eae9a
								
							
						
					
					
						commit
						285cf12e37
					
				|  | @ -17,9 +17,6 @@ | ||||||
| #include "rootston/output.h" | #include "rootston/output.h" | ||||||
| #include "rootston/server.h" | #include "rootston/server.h" | ||||||
| 
 | 
 | ||||||
| typedef void (*surface_iterator_func_t)(struct wlr_surface *surface, |  | ||||||
| 	double lx, double ly, float rotation, void *data); |  | ||||||
| 
 |  | ||||||
| /**
 | /**
 | ||||||
|  * Rotate a child's position relative to a parent. The parent size is (pw, ph), |  * Rotate a child's position relative to a parent. The parent size is (pw, ph), | ||||||
|  * the child position is (*sx, *sy) and its size is (sw, sh). |  * the child position is (*sx, *sy) and its size is (sw, sh). | ||||||
|  | @ -38,70 +35,58 @@ static void rotate_child_position(double *sx, double *sy, double sw, double sh, | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| struct surface_iterator_data { | struct layout_data { | ||||||
| 	surface_iterator_func_t user_iterator; |  | ||||||
| 	void *user_data; |  | ||||||
| 	double x, y; | 	double x, y; | ||||||
| 	int width, height; | 	int width, height; | ||||||
| 	float rotation; | 	float rotation; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| static void surface_iterator(struct wlr_surface *surface, int _sx, int _sy, | static void get_layout_position(struct layout_data *data, double *lx, double *ly, | ||||||
| 		void *data) { | 		const struct wlr_surface *surface, int sx, int sy) { | ||||||
| 	struct surface_iterator_data *iter_data = data; | 	double _sx = sx, _sy = sy; | ||||||
| 
 | 	rotate_child_position(&_sx, &_sy, surface->current->width, | ||||||
| 	double sx = _sx, sy = _sy; | 		surface->current->height, data->width, data->height, data->rotation); | ||||||
| 	rotate_child_position(&sx, &sy, surface->current->width, | 	*lx = data->x + _sx; | ||||||
| 		surface->current->height, iter_data->width, iter_data->height, | 	*ly = data->y + _sy; | ||||||
| 		iter_data->rotation); |  | ||||||
| 
 |  | ||||||
| 	iter_data->user_iterator(surface, iter_data->x + sx, iter_data->y + sy, |  | ||||||
| 		iter_data->rotation, iter_data->user_data); |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static void surface_for_each_surface(struct wlr_surface *surface, double lx, | static void surface_for_each_surface(struct wlr_surface *surface, | ||||||
| 		double ly, float rotation, surface_iterator_func_t iterator, | 		double lx, double ly, float rotation, struct layout_data *layout_data, | ||||||
| 		void *user_data) { | 		wlr_surface_iterator_func_t iterator, void *user_data) { | ||||||
| 	struct surface_iterator_data data = { | 	layout_data->x = lx; | ||||||
| 		.user_iterator = iterator, | 	layout_data->y = ly; | ||||||
| 		.user_data = user_data, | 	layout_data->width = surface->current->width; | ||||||
| 		.x = lx, .y = ly, | 	layout_data->height = surface->current->height; | ||||||
| 		.width = surface->current->width, | 	layout_data->rotation = rotation; | ||||||
| 		.height = surface->current->height, |  | ||||||
| 		.rotation = rotation, |  | ||||||
| 	}; |  | ||||||
| 
 | 
 | ||||||
| 	wlr_surface_for_each_surface(surface, surface_iterator, &data); | 	wlr_surface_for_each_surface(surface, iterator, user_data); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static void view_for_each_surface(struct roots_view *view, | static void view_for_each_surface(struct roots_view *view, | ||||||
| 		surface_iterator_func_t iterator, void *user_data) { | 		struct layout_data *layout_data, wlr_surface_iterator_func_t iterator, | ||||||
| 	struct surface_iterator_data data = { | 		void *user_data) { | ||||||
| 		.user_iterator = iterator, | 	layout_data->x = view->x; | ||||||
| 		.user_data = user_data, | 	layout_data->y = view->y; | ||||||
| 		.x = view->x, .y = view->y, | 	layout_data->width = view->wlr_surface->current->width; | ||||||
| 		.width = view->wlr_surface->current->width, | 	layout_data->height = view->wlr_surface->current->height; | ||||||
| 		.height = view->wlr_surface->current->height, | 	layout_data->rotation = view->rotation; | ||||||
| 		.rotation = view->rotation, |  | ||||||
| 	}; |  | ||||||
| 
 | 
 | ||||||
| 	switch (view->type) { | 	switch (view->type) { | ||||||
| 	case ROOTS_XDG_SHELL_V6_VIEW: | 	case ROOTS_XDG_SHELL_V6_VIEW: | ||||||
| 		wlr_xdg_surface_v6_for_each_surface(view->xdg_surface_v6, | 		wlr_xdg_surface_v6_for_each_surface(view->xdg_surface_v6, iterator, | ||||||
| 			surface_iterator, &data); | 			user_data); | ||||||
| 		break; | 		break; | ||||||
| 	case ROOTS_XDG_SHELL_VIEW: | 	case ROOTS_XDG_SHELL_VIEW: | ||||||
| 		wlr_xdg_surface_for_each_surface(view->xdg_surface, surface_iterator, | 		wlr_xdg_surface_for_each_surface(view->xdg_surface, iterator, | ||||||
| 			&data); | 			user_data); | ||||||
| 		break; | 		break; | ||||||
| 	case ROOTS_WL_SHELL_VIEW: | 	case ROOTS_WL_SHELL_VIEW: | ||||||
| 		wlr_wl_shell_surface_for_each_surface(view->wl_shell_surface, | 		wlr_wl_shell_surface_for_each_surface(view->wl_shell_surface, iterator, | ||||||
| 			surface_iterator, &data); | 			user_data); | ||||||
| 		break; | 		break; | ||||||
| #ifdef WLR_HAS_XWAYLAND | #ifdef WLR_HAS_XWAYLAND | ||||||
| 	case ROOTS_XWAYLAND_VIEW: | 	case ROOTS_XWAYLAND_VIEW: | ||||||
| 		wlr_surface_for_each_surface(view->wlr_surface, surface_iterator, | 		wlr_surface_for_each_surface(view->wlr_surface, iterator, user_data); | ||||||
| 			&data); |  | ||||||
| 		break; | 		break; | ||||||
| #endif | #endif | ||||||
| 	} | 	} | ||||||
|  | @ -110,20 +95,23 @@ static void view_for_each_surface(struct roots_view *view, | ||||||
| #ifdef WLR_HAS_XWAYLAND | #ifdef WLR_HAS_XWAYLAND | ||||||
| static void xwayland_children_for_each_surface( | static void xwayland_children_for_each_surface( | ||||||
| 		struct wlr_xwayland_surface *surface, | 		struct wlr_xwayland_surface *surface, | ||||||
| 		surface_iterator_func_t iterator, void *user_data) { | 		wlr_surface_iterator_func_t iterator, struct layout_data *layout_data, | ||||||
|  | 		void *user_data) { | ||||||
| 	struct wlr_xwayland_surface *child; | 	struct wlr_xwayland_surface *child; | ||||||
| 	wl_list_for_each(child, &surface->children, parent_link) { | 	wl_list_for_each(child, &surface->children, parent_link) { | ||||||
| 		if (child->mapped) { | 		if (child->mapped) { | ||||||
| 			surface_for_each_surface(child->surface, child->x, child->y, 0, | 			surface_for_each_surface(child->surface, child->x, child->y, 0, | ||||||
| 				iterator, user_data); | 				layout_data, iterator, user_data); | ||||||
| 		} | 		} | ||||||
| 		xwayland_children_for_each_surface(child, iterator, user_data); | 		xwayland_children_for_each_surface(child, iterator, layout_data, | ||||||
|  | 			user_data); | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| static void drag_icons_for_each_surface(struct roots_input *input, | static void drag_icons_for_each_surface(struct roots_input *input, | ||||||
| 		surface_iterator_func_t iterator, void *user_data) { | 		wlr_surface_iterator_func_t iterator, struct layout_data *layout_data, | ||||||
|  | 		void *user_data) { | ||||||
| 	struct roots_seat *seat; | 	struct roots_seat *seat; | ||||||
| 	wl_list_for_each(seat, &input->seats, link) { | 	wl_list_for_each(seat, &input->seats, link) { | ||||||
| 		struct roots_drag_icon *drag_icon; | 		struct roots_drag_icon *drag_icon; | ||||||
|  | @ -132,13 +120,15 @@ static void drag_icons_for_each_surface(struct roots_input *input, | ||||||
| 				continue; | 				continue; | ||||||
| 			} | 			} | ||||||
| 			surface_for_each_surface(drag_icon->wlr_drag_icon->surface, | 			surface_for_each_surface(drag_icon->wlr_drag_icon->surface, | ||||||
| 				drag_icon->x, drag_icon->y, 0, iterator, user_data); | 				drag_icon->x, drag_icon->y, 0, layout_data, | ||||||
|  | 				iterator, user_data); | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| struct render_data { | struct render_data { | ||||||
|  | 	struct layout_data layout; | ||||||
| 	struct roots_output *output; | 	struct roots_output *output; | ||||||
| 	struct timespec *when; | 	struct timespec *when; | ||||||
| 	pixman_region32_t *damage; | 	pixman_region32_t *damage; | ||||||
|  | @ -195,18 +185,23 @@ static void scissor_output(struct roots_output *output, pixman_box32_t *rect) { | ||||||
| 	wlr_renderer_scissor(renderer, &box); | 	wlr_renderer_scissor(renderer, &box); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static void render_surface(struct wlr_surface *surface, double lx, double ly, | static void render_surface(struct wlr_surface *surface, int sx, int sy, | ||||||
| 		float rotation, void *_data) { | 		void *_data) { | ||||||
| 	struct render_data *data = _data; | 	struct render_data *data = _data; | ||||||
| 	struct roots_output *output = data->output; | 	struct roots_output *output = data->output; | ||||||
| 	struct wlr_renderer *renderer = | 	float rotation = data->layout.rotation; | ||||||
| 		wlr_backend_get_renderer(output->wlr_output->backend); |  | ||||||
| 	assert(renderer); |  | ||||||
| 
 | 
 | ||||||
| 	if (!wlr_surface_has_buffer(surface)) { | 	if (!wlr_surface_has_buffer(surface)) { | ||||||
| 		return; | 		return; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	struct wlr_renderer *renderer = | ||||||
|  | 		wlr_backend_get_renderer(output->wlr_output->backend); | ||||||
|  | 	assert(renderer); | ||||||
|  | 
 | ||||||
|  | 	double lx, ly; | ||||||
|  | 	get_layout_position(&data->layout, &lx, &ly, surface, sx, sy); | ||||||
|  | 
 | ||||||
| 	struct wlr_box box; | 	struct wlr_box box; | ||||||
| 	bool intersects = surface_intersect_output(surface, output->desktop->layout, | 	bool intersects = surface_intersect_output(surface, output->desktop->layout, | ||||||
| 		output->wlr_output, lx, ly, rotation, &box); | 		output->wlr_output, lx, ly, rotation, &box); | ||||||
|  | @ -237,7 +232,8 @@ static void render_surface(struct wlr_surface *surface, double lx, double ly, | ||||||
| 	pixman_box32_t *rects = pixman_region32_rectangles(&damage, &nrects); | 	pixman_box32_t *rects = pixman_region32_rectangles(&damage, &nrects); | ||||||
| 	for (int i = 0; i < nrects; ++i) { | 	for (int i = 0; i < nrects; ++i) { | ||||||
| 		scissor_output(output, &rects[i]); | 		scissor_output(output, &rects[i]); | ||||||
| 		wlr_render_texture_with_matrix(renderer, surface->texture, matrix, data->alpha); | 		wlr_render_texture_with_matrix(renderer, surface->texture, matrix, | ||||||
|  | 			data->alpha); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| damage_finish: | damage_finish: | ||||||
|  | @ -319,7 +315,7 @@ static void render_view(struct roots_view *view, struct render_data *data) { | ||||||
| 
 | 
 | ||||||
| 	data->alpha = view->alpha; | 	data->alpha = view->alpha; | ||||||
| 	render_decorations(view, data); | 	render_decorations(view, data); | ||||||
| 	view_for_each_surface(view, render_surface, data); | 	view_for_each_surface(view, &data->layout, render_surface, data); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static bool has_standalone_surface(struct roots_view *view) { | static bool has_standalone_surface(struct roots_view *view) { | ||||||
|  | @ -342,11 +338,15 @@ static bool has_standalone_surface(struct roots_view *view) { | ||||||
| 	return true; | 	return true; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static void surface_send_frame_done(struct wlr_surface *surface, double lx, | static void surface_send_frame_done(struct wlr_surface *surface, int sx, int sy, | ||||||
| 		double ly, float rotation, void *_data) { | 		void *_data) { | ||||||
| 	struct render_data *data = _data; | 	struct render_data *data = _data; | ||||||
| 	struct roots_output *output = data->output; | 	struct roots_output *output = data->output; | ||||||
| 	struct timespec *when = data->when; | 	struct timespec *when = data->when; | ||||||
|  | 	float rotation = data->layout.rotation; | ||||||
|  | 
 | ||||||
|  | 	double lx, ly; | ||||||
|  | 	get_layout_position(&data->layout, &lx, &ly, surface, sx, sy); | ||||||
| 
 | 
 | ||||||
| 	if (!surface_intersect_output(surface, output->desktop->layout, | 	if (!surface_intersect_output(surface, output->desktop->layout, | ||||||
| 			output->wlr_output, lx, ly, rotation, NULL)) { | 			output->wlr_output, lx, ly, rotation, NULL)) { | ||||||
|  | @ -356,18 +356,17 @@ static void surface_send_frame_done(struct wlr_surface *surface, double lx, | ||||||
| 	wlr_surface_send_frame_done(surface, when); | 	wlr_surface_send_frame_done(surface, when); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static void render_layer( | static void render_layer(struct roots_output *output, | ||||||
| 		struct roots_output *output, | 		const struct wlr_box *output_layout_box, struct render_data *data, | ||||||
| 		const struct wlr_box *output_layout_box, |  | ||||||
| 		struct render_data *data, |  | ||||||
| 		struct wl_list *layer) { | 		struct wl_list *layer) { | ||||||
| 	struct roots_layer_surface *roots_surface; | 	struct roots_layer_surface *roots_surface; | ||||||
| 	wl_list_for_each(roots_surface, layer, link) { | 	wl_list_for_each(roots_surface, layer, link) { | ||||||
| 		struct wlr_layer_surface *layer = roots_surface->layer_surface; | 		struct wlr_layer_surface *layer = roots_surface->layer_surface; | ||||||
| 		render_surface(layer->surface, | 
 | ||||||
| 				roots_surface->geo.x + output_layout_box->x, | 		surface_for_each_surface(layer->surface, | ||||||
| 				roots_surface->geo.y + output_layout_box->y, | 			roots_surface->geo.x + output_layout_box->x, | ||||||
| 				0, data); | 			roots_surface->geo.y + output_layout_box->y, | ||||||
|  | 			0, &data->layout, render_surface, data); | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -480,7 +479,7 @@ static void render_output(struct roots_output *output) { | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		if (view->wlr_surface != NULL) { | 		if (view->wlr_surface != NULL) { | ||||||
| 			view_for_each_surface(view, render_surface, &data); | 			view_for_each_surface(view, &data.layout, render_surface, &data); | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		// During normal rendering the xwayland window tree isn't traversed
 | 		// During normal rendering the xwayland window tree isn't traversed
 | ||||||
|  | @ -489,7 +488,7 @@ static void render_output(struct roots_output *output) { | ||||||
| #ifdef WLR_HAS_XWAYLAND | #ifdef WLR_HAS_XWAYLAND | ||||||
| 		if (view->type == ROOTS_XWAYLAND_VIEW) { | 		if (view->type == ROOTS_XWAYLAND_VIEW) { | ||||||
| 			xwayland_children_for_each_surface(view->xwayland_surface, | 			xwayland_children_for_each_surface(view->xwayland_surface, | ||||||
| 				render_surface, &data); | 				render_surface, &data.layout, &data); | ||||||
| 		} | 		} | ||||||
| #endif | #endif | ||||||
| 	} else { | 	} else { | ||||||
|  | @ -505,7 +504,8 @@ static void render_output(struct roots_output *output) { | ||||||
| 
 | 
 | ||||||
| 	// Render drag icons
 | 	// Render drag icons
 | ||||||
| 	data.alpha = 1.0; | 	data.alpha = 1.0; | ||||||
| 	drag_icons_for_each_surface(server->input, render_surface, &data); | 	drag_icons_for_each_surface(server->input, render_surface, &data.layout, | ||||||
|  | 		&data); | ||||||
| 
 | 
 | ||||||
| 	render_layer(output, output_box, &data, | 	render_layer(output, output_box, &data, | ||||||
| 			&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY]); | 			&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY]); | ||||||
|  | @ -529,22 +529,24 @@ damage_finish: | ||||||
| 			return; | 			return; | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		view_for_each_surface(view, surface_send_frame_done, &data); | 		view_for_each_surface(view, &data.layout, surface_send_frame_done, | ||||||
|  | 			&data); | ||||||
| 
 | 
 | ||||||
| #ifdef WLR_HAS_XWAYLAND | #ifdef WLR_HAS_XWAYLAND | ||||||
| 		if (view->type == ROOTS_XWAYLAND_VIEW) { | 		if (view->type == ROOTS_XWAYLAND_VIEW) { | ||||||
| 			xwayland_children_for_each_surface(view->xwayland_surface, | 			xwayland_children_for_each_surface(view->xwayland_surface, | ||||||
| 				surface_send_frame_done, &data); | 				surface_send_frame_done, &data.layout, &data); | ||||||
| 		} | 		} | ||||||
| #endif | #endif | ||||||
| 	} else { | 	} else { | ||||||
| 		struct roots_view *view; | 		struct roots_view *view; | ||||||
| 		wl_list_for_each_reverse(view, &desktop->views, link) { | 		wl_list_for_each_reverse(view, &desktop->views, link) { | ||||||
| 			view_for_each_surface(view, surface_send_frame_done, &data); | 			view_for_each_surface(view, &data.layout, surface_send_frame_done, | ||||||
|  | 				&data); | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		drag_icons_for_each_surface(server->input, surface_send_frame_done, | 		drag_icons_for_each_surface(server->input, surface_send_frame_done, | ||||||
| 			&data); | 			&data.layout, &data); | ||||||
| 	} | 	} | ||||||
| 	layers_send_done(output, data.when); | 	layers_send_done(output, data.when); | ||||||
| } | } | ||||||
|  | @ -580,9 +582,19 @@ static bool view_accept_damage(struct roots_output *output, | ||||||
| 	return false; | 	return false; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static void damage_whole_surface(struct wlr_surface *surface, | struct damage_data { | ||||||
| 		double lx, double ly, float rotation, void *data) { | 	struct layout_data layout; | ||||||
| 	struct roots_output *output = data; | 	struct roots_output *output; | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | static void damage_whole_surface(struct wlr_surface *surface, int sx, int sy, | ||||||
|  | 		void *_data) { | ||||||
|  | 	struct damage_data *data = _data; | ||||||
|  | 	struct roots_output *output = data->output; | ||||||
|  | 	float rotation = data->layout.rotation; | ||||||
|  | 
 | ||||||
|  | 	double lx, ly; | ||||||
|  | 	get_layout_position(&data->layout, &lx, &ly, surface, sx, sy); | ||||||
| 
 | 
 | ||||||
| 	if (!wlr_surface_has_buffer(surface)) { | 	if (!wlr_surface_has_buffer(surface)) { | ||||||
| 		return; | 		return; | ||||||
|  | @ -607,9 +619,9 @@ void output_damage_whole_local_surface(struct roots_output *output, | ||||||
| 		struct wlr_surface *surface, double ox, double oy, float rotation) { | 		struct wlr_surface *surface, double ox, double oy, float rotation) { | ||||||
| 	struct wlr_output_layout_output *layout = wlr_output_layout_get( | 	struct wlr_output_layout_output *layout = wlr_output_layout_get( | ||||||
| 		output->desktop->layout, output->wlr_output); | 		output->desktop->layout, output->wlr_output); | ||||||
| 	damage_whole_surface(surface, ox + layout->x, oy + layout->y, | 	struct damage_data data = { .output = output }; | ||||||
| 			rotation, output); | 	surface_for_each_surface(surface, ox + layout->x, oy + layout->y, 0, | ||||||
| 	// TODO: subsurfaces
 | 		&data.layout, damage_whole_surface, &data); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static void damage_whole_decoration(struct roots_view *view, | static void damage_whole_decoration(struct roots_view *view, | ||||||
|  | @ -633,19 +645,27 @@ void output_damage_whole_view(struct roots_output *output, | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	damage_whole_decoration(view, output); | 	damage_whole_decoration(view, output); | ||||||
| 	view_for_each_surface(view, damage_whole_surface, output); | 
 | ||||||
|  | 	struct damage_data data = { .output = output }; | ||||||
|  | 	view_for_each_surface(view, &data.layout, damage_whole_surface, &data); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void output_damage_whole_drag_icon(struct roots_output *output, | void output_damage_whole_drag_icon(struct roots_output *output, | ||||||
| 		struct roots_drag_icon *icon) { | 		struct roots_drag_icon *icon) { | ||||||
|  | 	struct damage_data data = { .output = output }; | ||||||
| 	surface_for_each_surface(icon->wlr_drag_icon->surface, icon->x, icon->y, 0, | 	surface_for_each_surface(icon->wlr_drag_icon->surface, icon->x, icon->y, 0, | ||||||
| 		damage_whole_surface, output); | 		&data.layout, damage_whole_surface, &data); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static void damage_from_surface(struct wlr_surface *surface, | static void damage_from_surface(struct wlr_surface *surface, int sx, int sy, | ||||||
| 		double lx, double ly, float rotation, void *data) { | 		void *_data) { | ||||||
| 	struct roots_output *output = data; | 	struct damage_data *data = _data; | ||||||
|  | 	struct roots_output *output = data->output; | ||||||
| 	struct wlr_output *wlr_output = output->wlr_output; | 	struct wlr_output *wlr_output = output->wlr_output; | ||||||
|  | 	float rotation = data->layout.rotation; | ||||||
|  | 
 | ||||||
|  | 	double lx, ly; | ||||||
|  | 	get_layout_position(&data->layout, &lx, &ly, surface, sx, sy); | ||||||
| 
 | 
 | ||||||
| 	if (!wlr_surface_has_buffer(surface)) { | 	if (!wlr_surface_has_buffer(surface)) { | ||||||
| 		return; | 		return; | ||||||
|  | @ -681,9 +701,9 @@ void output_damage_from_local_surface(struct roots_output *output, | ||||||
| 		struct wlr_surface *surface, double ox, double oy, float rotation) { | 		struct wlr_surface *surface, double ox, double oy, float rotation) { | ||||||
| 	struct wlr_output_layout_output *layout = wlr_output_layout_get( | 	struct wlr_output_layout_output *layout = wlr_output_layout_get( | ||||||
| 		output->desktop->layout, output->wlr_output); | 		output->desktop->layout, output->wlr_output); | ||||||
| 	damage_from_surface(surface, ox + layout->x, oy + layout->y, | 	struct damage_data data = { .output = output }; | ||||||
| 			rotation, output); | 	surface_for_each_surface(surface, ox + layout->x, oy + layout->y, 0, | ||||||
| 	// TODO: Subsurfaces
 | 		&data.layout, damage_from_surface, &data); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void output_damage_from_view(struct roots_output *output, | void output_damage_from_view(struct roots_output *output, | ||||||
|  | @ -692,7 +712,8 @@ void output_damage_from_view(struct roots_output *output, | ||||||
| 		return; | 		return; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	view_for_each_surface(view, damage_from_surface, output); | 	struct damage_data data = { .output = output }; | ||||||
|  | 	view_for_each_surface(view, &data.layout, damage_from_surface, &data); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static void set_mode(struct wlr_output *output, | static void set_mode(struct wlr_output *output, | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue