weston: Add a specific option to load XWayland
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net> Reviewed-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
+17
-5
@@ -845,7 +845,7 @@ wet_load_shell(struct weston_compositor *compositor,
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
load_modules(struct weston_compositor *ec, const char *modules,
|
load_modules(struct weston_compositor *ec, const char *modules,
|
||||||
int *argc, char *argv[])
|
int *argc, char *argv[], int32_t *xwayland)
|
||||||
{
|
{
|
||||||
const char *p, *end;
|
const char *p, *end;
|
||||||
char buffer[256];
|
char buffer[256];
|
||||||
@@ -859,8 +859,10 @@ load_modules(struct weston_compositor *ec, const char *modules,
|
|||||||
snprintf(buffer, sizeof buffer, "%.*s", (int) (end - p), p);
|
snprintf(buffer, sizeof buffer, "%.*s", (int) (end - p), p);
|
||||||
|
|
||||||
if (strstr(buffer, "xwayland.so")) {
|
if (strstr(buffer, "xwayland.so")) {
|
||||||
if (wet_load_xwayland(ec) < 0)
|
weston_log("Old Xwayland module loading detected:"
|
||||||
return -1;
|
"Please use --xwayland command line option"
|
||||||
|
"or weston.ini xwayland=true\n");
|
||||||
|
*xwayland = 1;
|
||||||
} else {
|
} else {
|
||||||
if (wet_load_module(ec, buffer, argc, argv) < 0)
|
if (wet_load_module(ec, buffer, argc, argv) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@@ -1756,6 +1758,7 @@ int main(int argc, char *argv[])
|
|||||||
int i, fd;
|
int i, fd;
|
||||||
char *backend = NULL;
|
char *backend = NULL;
|
||||||
char *shell = NULL;
|
char *shell = NULL;
|
||||||
|
int32_t xwayland = 0;
|
||||||
char *modules = NULL;
|
char *modules = NULL;
|
||||||
char *option_modules = NULL;
|
char *option_modules = NULL;
|
||||||
char *log = NULL;
|
char *log = NULL;
|
||||||
@@ -1780,6 +1783,7 @@ int main(int argc, char *argv[])
|
|||||||
{ WESTON_OPTION_STRING, "shell", 0, &shell },
|
{ WESTON_OPTION_STRING, "shell", 0, &shell },
|
||||||
{ WESTON_OPTION_STRING, "socket", 'S', &socket_name },
|
{ WESTON_OPTION_STRING, "socket", 'S', &socket_name },
|
||||||
{ WESTON_OPTION_INTEGER, "idle-time", 'i', &idle_time },
|
{ WESTON_OPTION_INTEGER, "idle-time", 'i', &idle_time },
|
||||||
|
{ WESTON_OPTION_BOOLEAN, "xwayland", 0, &xwayland },
|
||||||
{ WESTON_OPTION_STRING, "modules", 0, &option_modules },
|
{ WESTON_OPTION_STRING, "modules", 0, &option_modules },
|
||||||
{ WESTON_OPTION_STRING, "log", 0, &log },
|
{ WESTON_OPTION_STRING, "log", 0, &log },
|
||||||
{ WESTON_OPTION_BOOLEAN, "help", 'h', &help },
|
{ WESTON_OPTION_BOOLEAN, "help", 'h', &help },
|
||||||
@@ -1914,12 +1918,20 @@ int main(int argc, char *argv[])
|
|||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
weston_config_section_get_string(section, "modules", &modules, "");
|
weston_config_section_get_string(section, "modules", &modules, "");
|
||||||
if (load_modules(ec, modules, &argc, argv) < 0)
|
if (load_modules(ec, modules, &argc, argv, &xwayland) < 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (load_modules(ec, option_modules, &argc, argv) < 0)
|
if (load_modules(ec, option_modules, &argc, argv, &xwayland) < 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
if (!xwayland)
|
||||||
|
weston_config_section_get_bool(section, "xwayland", &xwayland,
|
||||||
|
false);
|
||||||
|
if (xwayland) {
|
||||||
|
if (wet_load_xwayland(ec) < 0)
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
section = weston_config_get_section(config, "keyboard", NULL, NULL);
|
section = weston_config_get_section(config, "keyboard", NULL, NULL);
|
||||||
weston_config_section_get_bool(section, "numlock-on", &numlock_on, 0);
|
weston_config_section_get_bool(section, "numlock-on", &numlock_on, 0);
|
||||||
if (numlock_on) {
|
if (numlock_on) {
|
||||||
|
|||||||
+5
-2
@@ -106,14 +106,17 @@ directory are:
|
|||||||
.fi
|
.fi
|
||||||
.RE
|
.RE
|
||||||
.TP 7
|
.TP 7
|
||||||
.BI "modules=" xwayland.so,cms-colord.so
|
.BI "xwayland=" true
|
||||||
|
ask Weston to load the XWayland module (boolean).
|
||||||
|
.RE
|
||||||
|
.TP 7
|
||||||
|
.BI "modules=" cms-colord.so,screen-share.so
|
||||||
specifies the modules to load (string). Available modules in the
|
specifies the modules to load (string). Available modules in the
|
||||||
.IR "__weston_modules_dir__"
|
.IR "__weston_modules_dir__"
|
||||||
directory are:
|
directory are:
|
||||||
.PP
|
.PP
|
||||||
.RS 10
|
.RS 10
|
||||||
.nf
|
.nf
|
||||||
.BR xwayland.so
|
|
||||||
.BR cms-colord.so
|
.BR cms-colord.so
|
||||||
.BR screen-share.so
|
.BR screen-share.so
|
||||||
.fi
|
.fi
|
||||||
|
|||||||
+5
-2
@@ -83,7 +83,7 @@ the X server. XWayland provides backwards compatibility to X applications in a
|
|||||||
Wayland stack.
|
Wayland stack.
|
||||||
|
|
||||||
XWayland is activated by instructing
|
XWayland is activated by instructing
|
||||||
.BR weston " to load " xwayland.so " module, see " EXAMPLES .
|
.BR weston " to load the XWayland module, see " EXAMPLES .
|
||||||
Weston starts listening on a new X display socket, and exports it in the
|
Weston starts listening on a new X display socket, and exports it in the
|
||||||
environment variable
|
environment variable
|
||||||
.BR DISPLAY .
|
.BR DISPLAY .
|
||||||
@@ -143,6 +143,9 @@ Append log messages to the file
|
|||||||
.I file.log
|
.I file.log
|
||||||
instead of writing them to stderr.
|
instead of writing them to stderr.
|
||||||
.TP
|
.TP
|
||||||
|
\fB\-\-xwayland\fR
|
||||||
|
Ask Weston to load the XWayland module.
|
||||||
|
.TP
|
||||||
\fB\-\-modules\fR=\fImodule1.so,module2.so\fR
|
\fB\-\-modules\fR=\fImodule1.so,module2.so\fR
|
||||||
Load the comma-separated list of modules. Only used by the test
|
Load the comma-separated list of modules. Only used by the test
|
||||||
suite. The file is searched for in
|
suite. The file is searched for in
|
||||||
@@ -326,7 +329,7 @@ http://wayland.freedesktop.org/
|
|||||||
.IP "Launch Weston with the DRM backend on a VT"
|
.IP "Launch Weston with the DRM backend on a VT"
|
||||||
weston-launch
|
weston-launch
|
||||||
.IP "Launch Weston with the DRM backend and XWayland support"
|
.IP "Launch Weston with the DRM backend and XWayland support"
|
||||||
weston-launch -- --modules=xwayland.so
|
weston-launch -- --xwayland
|
||||||
.IP "Launch Weston (wayland-1) nested in another Weston instance (wayland-0)"
|
.IP "Launch Weston (wayland-1) nested in another Weston instance (wayland-0)"
|
||||||
WAYLAND_DISPLAY=wayland-0 weston -Swayland-1
|
WAYLAND_DISPLAY=wayland-0 weston -Swayland-1
|
||||||
.IP "From an X terminal, launch Weston with the x11 backend"
|
.IP "From an X terminal, launch Weston with the x11 backend"
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ MODDIR=$abs_builddir/.libs
|
|||||||
|
|
||||||
SHELL_PLUGIN=$MODDIR/desktop-shell.so
|
SHELL_PLUGIN=$MODDIR/desktop-shell.so
|
||||||
TEST_PLUGIN=$MODDIR/weston-test.so
|
TEST_PLUGIN=$MODDIR/weston-test.so
|
||||||
XWAYLAND_PLUGIN=$MODDIR/xwayland.so
|
|
||||||
|
|
||||||
CONFIG_FILE="${TEST_NAME}.ini"
|
CONFIG_FILE="${TEST_NAME}.ini"
|
||||||
|
|
||||||
@@ -60,7 +59,8 @@ case $TEST_FILE in
|
|||||||
${CONFIG} \
|
${CONFIG} \
|
||||||
--shell=$SHELL_PLUGIN \
|
--shell=$SHELL_PLUGIN \
|
||||||
--socket=test-${TEST_NAME} \
|
--socket=test-${TEST_NAME} \
|
||||||
--modules=$MODDIR/${TEST_FILE/.la/.so},$XWAYLAND_PLUGIN \
|
--xwayland \
|
||||||
|
--modules=$MODDIR/${TEST_FILE/.la/.so} \
|
||||||
--log="$SERVERLOG" \
|
--log="$SERVERLOG" \
|
||||||
&> "$OUTLOG"
|
&> "$OUTLOG"
|
||||||
;;
|
;;
|
||||||
@@ -89,7 +89,8 @@ case $TEST_FILE in
|
|||||||
${CONFIG} \
|
${CONFIG} \
|
||||||
--shell=$SHELL_PLUGIN \
|
--shell=$SHELL_PLUGIN \
|
||||||
--socket=test-${TEST_NAME} \
|
--socket=test-${TEST_NAME} \
|
||||||
--modules=$TEST_PLUGIN,$XWAYLAND_PLUGIN \
|
--xwayland \
|
||||||
|
--modules=$TEST_PLUGIN \
|
||||||
--log="$SERVERLOG" \
|
--log="$SERVERLOG" \
|
||||||
$($abs_builddir/$TEST_FILE --params) \
|
$($abs_builddir/$TEST_FILE --params) \
|
||||||
&> "$OUTLOG"
|
&> "$OUTLOG"
|
||||||
|
|||||||
+2
-1
@@ -1,5 +1,6 @@
|
|||||||
[core]
|
[core]
|
||||||
#modules=xwayland.so,cms-colord.so
|
#modules=cms-colord.so
|
||||||
|
#xwayland=true
|
||||||
#shell=desktop-shell.so
|
#shell=desktop-shell.so
|
||||||
#gbm-format=xrgb2101010
|
#gbm-format=xrgb2101010
|
||||||
#require-input=true
|
#require-input=true
|
||||||
|
|||||||
Reference in New Issue
Block a user