diff options
author | 2023-06-09 11:49:36 +0300 | |
---|---|---|
committer | 2023-06-09 11:53:06 +0300 | |
commit | 2f6794dbd5854ae5bad092d6b4332fe9fa76418e (patch) | |
tree | 5ae5b71784e7bd760149be2eedde47f9f6f14d81 | |
parent | b6e910b45f3d224b5573166cde1b009a33cdc2d9 (diff) |
layout: Add a fallback for reading activation-area
This is a temporary work-around for doing another read of the ini file
for the activation-area in case we detected that we have one set-up but
the activation area is empty. This happens when we're getting the ready()
request from the shell client, when we're initializing the layout.
Bug-AGL: SPEC-4829
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I152e7cba34b74390de2a46df4799c1fb44441d3f
-rw-r--r-- | src/compositor.c | 2 | ||||
-rw-r--r-- | src/ivi-compositor.h | 3 | ||||
-rw-r--r-- | src/layout.c | 18 |
3 files changed, 22 insertions, 1 deletions
diff --git a/src/compositor.c b/src/compositor.c index dc7ed4f..3cec66e 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -419,7 +419,7 @@ parse_transform(const char *transform, uint32_t *out) return -1; } -static int +int parse_activation_area(const char *geometry, struct ivi_output *output) { int n; diff --git a/src/ivi-compositor.h b/src/ivi-compositor.h index ed56c7f..4252d7e 100644 --- a/src/ivi-compositor.h +++ b/src/ivi-compositor.h @@ -507,4 +507,7 @@ shell_send_app_state(struct ivi_compositor *ivi, const char *app_id, void ivi_layout_destroy_saved_outputs(struct ivi_compositor *ivi); +int +parse_activation_area(const char *geometry, struct ivi_output *output); + #endif diff --git a/src/layout.c b/src/layout.c index e8fc767..ff5b55f 100644 --- a/src/layout.c +++ b/src/layout.c @@ -30,6 +30,7 @@ #include <assert.h> #include <string.h> +#include <libweston/config-parser.h> #include <libweston/libweston.h> #include <libweston-desktop/libweston-desktop.h> @@ -152,6 +153,23 @@ void ivi_layout_init(struct ivi_compositor *ivi, struct ivi_output *output) { bool use_default_area = true; + struct weston_config_section *section = output->config; + char *t; + + weston_config_section_get_string(section, "activation-area", &t, NULL); + if (t) { + if (output->area_activation.width == 0 && + output->area_activation.height == 0 && + output->area_activation.x == 0 && + output->area_activation.y == 0) { + weston_log("WARNING: activation-area set in " + "configuration file, but yet applied!\n"); + if (parse_activation_area(t, output) < 0) + weston_log("Invalid activation-area \"%s\" for output %s\n", + t, output->name); + } + } + free(t); ivi_background_init(ivi, output); |