From 6c2646e9670d0c56ee7b6de2a1ccad949d246910 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 16 Jan 2022 23:36:42 +0100 Subject: [PATCH] screen-share: Fix start-on-startup config option handling The code currently checked the return value of weston_config_section_get_bool() which is incorrect. The return value of weston_config_section_get_bool() is zero whether the config option is present or not, and it is non-zero in case the config option is not present. The code must check whether the config option is either true or false, or in case the option is not present then default to false. Adjust the code accordingly. Reviewed-by: Marius Vlad Signed-off-by: Marek Vasut --- compositor/screen-share.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compositor/screen-share.c b/compositor/screen-share.c index 4db07276..8906c6ad 100644 --- a/compositor/screen-share.c +++ b/compositor/screen-share.c @@ -1185,8 +1185,9 @@ wet_module_init(struct weston_compositor *compositor, MODIFIER_CTRL | MODIFIER_ALT, share_output_binding, ss); - if (weston_config_section_get_bool(section, "start-on-startup", - &start_on_startup, false) == 0) { + weston_config_section_get_bool(section, "start-on-startup", + &start_on_startup, false); + if (start_on_startup) { wl_list_for_each(output, &compositor->output_list, link) weston_output_share(output, ss->command); }