On Sat, Aug 18, 2012 at 07:52:42PM -0600, Scott Moreau wrote:
> This is a workaround for screenshots with transformed outputs. It reorders
> the output positions so the correct buffer size is determined for the final
> image. This assumes the outputs are in succession on the x axis. The outputs
> are rendered in their transformed state.

Committed, thanks.

> ---
>  clients/screenshot.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/clients/screenshot.c b/clients/screenshot.c
> index 7395bf3..0fa4e4b 100644
> --- a/clients/screenshot.c
> +++ b/clients/screenshot.c
> @@ -205,6 +205,12 @@ set_buffer_size(int *width, int *height)
>       struct screenshooter_output *output;
>       min_x = min_y = INT_MAX;
>       max_x = max_y = INT_MIN;
> +     int position = 0;
> +
> +     wl_list_for_each_reverse(output, &output_list, link) {
> +             output->offset_x = position;
> +             position += output->width;
> +     }

We should probably change the wl_list_insert in handle_global() to
insert at the end of the list:

        wl_list_insert(output_list.prev, &output->link);

instead of the reverse iteration.

>       wl_list_for_each(output, &output_list, link) {
>               min_x = MIN(min_x, output->offset_x);
> -- 
> 1.7.11.2
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to