summaryrefslogtreecommitdiff
path: root/clients/desktop-shell.c
diff options
context:
space:
mode:
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>2015-03-24 15:56:19 +0200
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2015-03-27 09:38:12 +0200
commit6c71aaeec5d034e052c9d95f3c36b5b38069f6d8 (patch)
tree6a5d8b4cebb294d03b583e891553c5fcffc26cff /clients/desktop-shell.c
parentdc940caae54ee8a631a30d76b54b209dab322d12 (diff)
downloadweston-6c71aaeec5d034e052c9d95f3c36b5b38069f6d8.tar.gz
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>
Diffstat (limited to 'clients/desktop-shell.c')
-rw-r--r--clients/desktop-shell.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c
index 961a9b24..ac2928f1 100644
--- a/clients/desktop-shell.c
+++ b/clients/desktop-shell.c
@@ -1328,11 +1328,13 @@ int main(int argc, char *argv[])
struct desktop desktop = { 0 };
struct output *output;
struct weston_config_section *s;
+ const char *config_file;
desktop.unlock_task.run = unlock_dialog_finish;
wl_list_init(&desktop.outputs);
- desktop.config = weston_config_parse("weston.ini");
+ config_file = weston_config_get_name_from_env();
+ desktop.config = weston_config_parse(config_file);
s = weston_config_get_section(desktop.config, "shell", NULL, NULL);
weston_config_section_get_bool(s, "locking", &desktop.locking, 1);