screen-share: Add option to start screen sharing on weston startup

Currently the screen sharing has to be manually started after weston has
started by pressing Ctrl+Alt+S on a keyboard. Add new bool config option
to the screen-share section which permits starting the screen sharing of
all outputs on weston start up. This is useful e.g. for doing screen
mirroring between two devices over network.

Signed-off-by: Marek Vasut <marex@denx.de>
This commit is contained in:
Marek Vasut 2021-09-21 22:32:21 +02:00 committed by Pekka Paalanen
parent c00aba6893
commit b02149e43b
3 changed files with 16 additions and 0 deletions

View File

@ -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;
}

View File

@ -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"

View File

@ -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