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 <marius.vlad@collabora.com>
Signed-off-by: Marek Vasut <marex@denx.de>
dev
Marek Vasut 3 years ago committed by Daniel Stone
parent f079f43658
commit 6c2646e967
  1. 5
      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);
}

Loading…
Cancel
Save