From 31af69d8684e524aba88e06ed75e8d89ba64bf53 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 25 Nov 2019 23:35:36 +0000 Subject: [PATCH] compositor: Fix default transforms when output section declared Regardless of the default transform passed in, weston_parse_transform would always return 'normal' if there was an output section. This is because, if a section was declared for that output, it would ask weston_config for the transform, with the default being 'normal'. Fix it so we return the passed-in default transform when we have a matching output section without a transform key. If the transform is declared but invalid, we can remove the line resetting to the default transform, because we've already set the default transform up top. Signed-off-by: Daniel Stone --- compositor/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/compositor/main.c b/compositor/main.c index 7fbbb574..d386389a 100644 --- a/compositor/main.c +++ b/compositor/main.c @@ -1214,17 +1214,18 @@ wet_output_set_transform(struct weston_output *output, uint32_t default_transform, uint32_t parsed_transform) { - char *t; + char *t = NULL; uint32_t transform = default_transform; if (section) { weston_config_section_get_string(section, - "transform", &t, "normal"); + "transform", &t, NULL); + } + if (t) { if (weston_parse_transform(t, &transform) < 0) { weston_log("Invalid transform \"%s\" for output %s\n", t, output->name); - transform = default_transform; } free(t); }