summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2021-09-21 22:32:21 +0200
committerPekka Paalanen <pq@iki.fi>2021-10-27 08:52:17 +0000
commitb02149e43b798899d980454a5b8f1adb8c575e25 (patch)
tree29dbd61319edb5a3f64c305e9b0aec06b9df6f7e
parentc00aba6893cb0d51f6ec1635db98488bbb576f69 (diff)
downloadweston-b02149e43b798899d980454a5b8f1adb8c575e25.tar.gz
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>
-rw-r--r--compositor/screen-share.c9
-rw-r--r--man/weston.ini.man6
-rw-r--r--weston.ini.in1
3 files changed, 16 insertions, 0 deletions
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