diff --git a/compositor/screen-share.c b/compositor/screen-share.c index c8c40a3f..4db07276 100644 --- a/compositor/screen-share.c +++ b/compositor/screen-share.c @@ -1165,8 +1165,10 @@ wet_module_init(struct weston_compositor *compositor, int *argc, char *argv[]) { struct screen_share *ss; + struct weston_output *output; struct weston_config *config; struct weston_config_section *section; + bool start_on_startup = false; ss = zalloc(sizeof *ss); if (ss == NULL) @@ -1182,5 +1184,12 @@ wet_module_init(struct weston_compositor *compositor, weston_compositor_add_key_binding(compositor, KEY_S, MODIFIER_CTRL | MODIFIER_ALT, share_output_binding, ss); + + if (weston_config_section_get_bool(section, "start-on-startup", + &start_on_startup, false) == 0) { + wl_list_for_each(output, &compositor->output_list, link) + weston_output_share(output, ss->command); + } + return 0; } diff --git a/man/weston.ini.man b/man/weston.ini.man index 014a805e..3de49299 100644 --- a/man/weston.ini.man +++ b/man/weston.ini.man @@ -669,6 +669,12 @@ sets the path to the xserver to run (string). sets the command to start a fullscreen-shell server for screen sharing (string). .RE .RE +.TP 7 +.BI "start-on-startup=" "false" +If set to true, start screen sharing of all outputs available on Weston startup. +Set to false by default. +.RE +.RE .SH "AUTOLAUNCH SECTION" .TP 7 .BI "path=" "/usr/bin/echo" diff --git a/weston.ini.in b/weston.ini.in index 92ae569e..011b1942 100644 --- a/weston.ini.in +++ b/weston.ini.in @@ -79,6 +79,7 @@ path=@libexecdir@/weston-keyboard [screen-share] command=@bindir@/weston --backend=rdp-backend.so --shell=fullscreen-shell.so --no-clients-resize +#start-on-startup=false #[xwayland] #path=@bindir@/Xwayland