summaryrefslogtreecommitdiff
path: root/clients/screenshot.c
diff options
context:
space:
mode:
authorScott Moreau <oreaus@gmail.com>2012-08-18 19:52:42 -0600
committerKristian Høgsberg <krh@bitplanet.net>2012-08-29 14:47:30 -0400
commitbb5898341c344d421fce00f479efd66fb14457d3 (patch)
treefc4a82298845017faaa810d4e4198cedf2ecd2f1 /clients/screenshot.c
parentfdb4b025019edf9256d76223c9096f564a357f62 (diff)
downloadweston-bb5898341c344d421fce00f479efd66fb14457d3.tar.gz
screenshot: Use correct buffer size for transformed outputs.
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.
Diffstat (limited to 'clients/screenshot.c')
-rw-r--r--clients/screenshot.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/clients/screenshot.c b/clients/screenshot.c
index 7395bf3f..0fa4e4b7 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;
+ }
wl_list_for_each(output, &output_list, link) {
min_x = MIN(min_x, output->offset_x);