Pass config file from compositor to everything
We have the Weston command line option '--no-config' which is meant to prevent loading weston.ini at all. It works for Weston itself, but it does not work for any clients that also want to read weston.ini. To fix that, introduce a new environment variable WESTON_CONFIG_FILE. Weston will set it to the absolute path of the config file it loads. Clients will load the config file pointed to by WESTON_CONFIG_FILE. If the environment variable is set but empty, no config file will be loaded. If the variable is unset, things fall back to the default "weston.ini". Note, that Weston will only set WESTON_CONFIG_FILE, it never reads it. The ability to specify a custom config file to load will be another patch. All programs that loaded "weston.ini" are modified to honour WESTON_CONFIG_FILE. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Jonny Lamb <jonny.lamb@collabora.co.uk> Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
This commit is contained in:
+7
-2
@@ -5215,16 +5215,21 @@ weston_transform_to_string(uint32_t output_transform)
|
||||
static int
|
||||
load_configuration(struct weston_config **config, int32_t noconfig)
|
||||
{
|
||||
const char *full_path;
|
||||
|
||||
*config = NULL;
|
||||
|
||||
if (noconfig == 0)
|
||||
*config = weston_config_parse("weston.ini");
|
||||
|
||||
if (*config) {
|
||||
weston_log("Using config file '%s'\n",
|
||||
weston_config_get_full_path(*config));
|
||||
full_path = weston_config_get_full_path(*config);
|
||||
|
||||
weston_log("Using config file '%s'\n", full_path);
|
||||
setenv(WESTON_CONFIG_FILE_ENV_VAR, full_path, 1);
|
||||
} else {
|
||||
weston_log("Starting with no config file.\n");
|
||||
setenv(WESTON_CONFIG_FILE_ENV_VAR, "", 1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user