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>
dev
Marek Vasut 3 years ago committed by Pekka Paalanen
parent c00aba6893
commit b02149e43b
  1. 9
      compositor/screen-share.c
  2. 6
      man/weston.ini.man
  3. 1
      weston.ini.in

@ -1165,8 +1165,10 @@ wet_module_init(struct weston_compositor *compositor,
int *argc, char *argv[]) int *argc, char *argv[])
{ {
struct screen_share *ss; struct screen_share *ss;
struct weston_output *output;
struct weston_config *config; struct weston_config *config;
struct weston_config_section *section; struct weston_config_section *section;
bool start_on_startup = false;
ss = zalloc(sizeof *ss); ss = zalloc(sizeof *ss);
if (ss == NULL) if (ss == NULL)
@ -1182,5 +1184,12 @@ wet_module_init(struct weston_compositor *compositor,
weston_compositor_add_key_binding(compositor, KEY_S, weston_compositor_add_key_binding(compositor, KEY_S,
MODIFIER_CTRL | MODIFIER_ALT, MODIFIER_CTRL | MODIFIER_ALT,
share_output_binding, ss); 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; return 0;
} }

@ -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). sets the command to start a fullscreen-shell server for screen sharing (string).
.RE .RE
.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" .SH "AUTOLAUNCH SECTION"
.TP 7 .TP 7
.BI "path=" "/usr/bin/echo" .BI "path=" "/usr/bin/echo"

@ -79,6 +79,7 @@ path=@libexecdir@/weston-keyboard
[screen-share] [screen-share]
command=@bindir@/weston --backend=rdp-backend.so --shell=fullscreen-shell.so --no-clients-resize command=@bindir@/weston --backend=rdp-backend.so --shell=fullscreen-shell.so --no-clients-resize
#start-on-startup=false
#[xwayland] #[xwayland]
#path=@bindir@/Xwayland #path=@bindir@/Xwayland

Loading…
Cancel
Save