summaryrefslogtreecommitdiff
path: root/clients
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
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')
-rw-r--r--clients/desktop-shell.c4
-rw-r--r--clients/ivi-shell-user-interface.c4
-rw-r--r--clients/terminal.c4
-rw-r--r--clients/window.c4
4 files changed, 12 insertions, 4 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);
diff --git a/clients/ivi-shell-user-interface.c b/clients/ivi-shell-user-interface.c
index 324ea7a6..a83f9ade 100644
--- a/clients/ivi-shell-user-interface.c
+++ b/clients/ivi-shell-user-interface.c
@@ -1073,6 +1073,7 @@ create_launchers(struct wlContextCommon *cmm, struct wl_list *launcher_list)
static struct hmi_homescreen_setting *
hmi_homescreen_setting_create(void)
{
+ const char *config_file;
struct weston_config *config = NULL;
struct weston_config_section *shellSection = NULL;
struct hmi_homescreen_setting *setting = MEM_ALLOC(sizeof(*setting));
@@ -1084,7 +1085,8 @@ hmi_homescreen_setting_create(void)
wl_list_init(&setting->workspace_list);
wl_list_init(&setting->launcher_list);
- config = weston_config_parse("weston.ini");
+ config_file = weston_config_get_name_from_env();
+ config = weston_config_parse(config_file);
shellSection =
weston_config_get_section(config, "ivi-shell", NULL, NULL);
diff --git a/clients/terminal.c b/clients/terminal.c
index 7c371016..3e89bdf5 100644
--- a/clients/terminal.c
+++ b/clients/terminal.c
@@ -3050,6 +3050,7 @@ int main(int argc, char *argv[])
{
struct display *d;
struct terminal *terminal;
+ const char *config_file;
struct weston_config *config;
struct weston_config_section *s;
@@ -3061,7 +3062,8 @@ int main(int argc, char *argv[])
if (!option_shell)
option_shell = "/bin/bash";
- config = weston_config_parse("weston.ini");
+ config_file = weston_config_get_name_from_env();
+ config = weston_config_parse(config_file);
s = weston_config_get_section(config, "terminal", NULL, NULL);
weston_config_section_get_string(s, "font", &option_font, "mono");
weston_config_section_get_int(s, "font-size", &option_font_size, 14);
diff --git a/clients/window.c b/clients/window.c
index 67034623..81e007be 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -1288,6 +1288,7 @@ static const struct cursor_alternatives cursors[] = {
static void
create_cursors(struct display *display)
{
+ const char *config_file;
struct weston_config *config;
struct weston_config_section *s;
int size;
@@ -1295,7 +1296,8 @@ create_cursors(struct display *display)
unsigned int i, j;
struct wl_cursor *cursor;
- config = weston_config_parse("weston.ini");
+ config_file = weston_config_get_name_from_env();
+ config = weston_config_parse(config_file);
s = weston_config_get_section(config, "shell", NULL, NULL);
weston_config_section_get_string(s, "cursor-theme", &theme, NULL);
weston_config_section_get_int(s, "cursor-size", &size, 32);