summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moreau <oreaus@gmail.com>2012-09-29 02:03:11 -0600
committerKristian Høgsberg <krh@bitplanet.net>2012-10-10 13:02:11 -0400
commit4e07236e8702ff22e2398214a15f7d1e7561caf6 (patch)
treea709c43fba24d355550b373b886bba711278ea88
parentb36f7ef99e01cadbcc46271f6fa4acc9dc930892 (diff)
toytoolkit: Take into account transform when sending output allocation.
-rw-r--r--clients/window.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/clients/window.c b/clients/window.c
index 1529dac1..b19c579d 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -238,6 +238,7 @@ struct output {
struct wl_output *output;
struct rectangle allocation;
struct wl_list link;
+ int transform;
display_output_handler_t destroy_handler;
void *user_data;
@@ -3454,6 +3455,7 @@ display_handle_geometry(void *data,
output->allocation.x = x;
output->allocation.y = y;
+ output->transform = transform;
}
static void
@@ -3546,9 +3548,22 @@ output_set_destroy_handler(struct output *output,
}
void
-output_get_allocation(struct output *output, struct rectangle *allocation)
+output_get_allocation(struct output *output, struct rectangle *base)
{
- *allocation = output->allocation;
+ struct rectangle allocation = output->allocation;
+
+ switch (output->transform) {
+ case WL_OUTPUT_TRANSFORM_90:
+ case WL_OUTPUT_TRANSFORM_270:
+ case WL_OUTPUT_TRANSFORM_FLIPPED_90:
+ case WL_OUTPUT_TRANSFORM_FLIPPED_270:
+ /* Swap width and height */
+ allocation.width = output->allocation.height;
+ allocation.height = output->allocation.width;
+ break;
+ }
+
+ *base = allocation;
}
struct wl_output *