diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-10-09 08:09:03 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-09 08:09:03 -0400 |
commit | d0d6413772a09f385bc16f5fc38eda114695ee16 (patch) | |
tree | 59ea3b1a314ede560f90f6e8b1058c1b54b90161 /rootston | |
parent | 7aa0e949b3849428aad426533e719562d7bb8ef9 (diff) | |
parent | 9cab66f0f914a0194cdfa178377f6413c33ac515 (diff) |
Merge pull request #220 from versusvoid/optional-xwayland
Make Xwayland optional
Diffstat (limited to 'rootston')
-rw-r--r-- | rootston/config.c | 16 | ||||
-rw-r--r-- | rootston/desktop.c | 14 | ||||
-rw-r--r-- | rootston/meson.build | 33 | ||||
-rw-r--r-- | rootston/rootston.ini.example | 4 |
4 files changed, 46 insertions, 21 deletions
diff --git a/rootston/config.c b/rootston/config.c index d454c2d9..4918c8dd 100644 --- a/rootston/config.c +++ b/rootston/config.c @@ -5,6 +5,7 @@ #include <limits.h> #include <getopt.h> #include <string.h> +#include <strings.h> #include <unistd.h> #include <sys/param.h> #include <wlr/util/log.h> @@ -114,7 +115,19 @@ static const char *device_prefix = "device:"; static int config_ini_handler(void *user, const char *section, const char *name, const char *value) { struct roots_config *config = user; - if (strncmp(output_prefix, section, strlen(output_prefix)) == 0) { + if (strcmp(section, "core") == 0) { + if (strcmp(name, "xwayland") == 0) { + if (strcasecmp(value, "true") == 0) { + config->xwayland = true; + } else if (strcasecmp(value, "false") == 0) { + config->xwayland = false; + } else { + wlr_log(L_ERROR, "got unknown xwayland value: %s", value); + } + } else { + wlr_log(L_ERROR, "got unknown core config: %s", name); + } + } else if (strncmp(output_prefix, section, strlen(output_prefix)) == 0) { const char *output_name = section + strlen(output_prefix); struct output_config *oc; bool found = false; @@ -251,6 +264,7 @@ static int config_ini_handler(void *user, const char *section, const char *name, struct roots_config *parse_args(int argc, char *argv[]) { struct roots_config *config = calloc(1, sizeof(struct roots_config)); + config->xwayland = true; wl_list_init(&config->outputs); wl_list_init(&config->devices); wl_list_init(&config->bindings); diff --git a/rootston/desktop.c b/rootston/desktop.c index b34fb19e..001cefe0 100644 --- a/rootston/desktop.c +++ b/rootston/desktop.c @@ -262,11 +262,15 @@ struct roots_desktop *desktop_create(struct roots_server *server, &desktop->wl_shell_surface); desktop->wl_shell_surface.notify = handle_wl_shell_surface; - desktop->xwayland = wlr_xwayland_create(server->wl_display, - desktop->compositor); - wl_signal_add(&desktop->xwayland->events.new_surface, - &desktop->xwayland_surface); - desktop->xwayland_surface.notify = handle_xwayland_surface; +#ifdef HAS_XWAYLAND + if (config->xwayland) { + desktop->xwayland = wlr_xwayland_create(server->wl_display, + desktop->compositor); + wl_signal_add(&desktop->xwayland->events.new_surface, + &desktop->xwayland_surface); + desktop->xwayland_surface.notify = handle_xwayland_surface; + } +#endif desktop->gamma_control_manager = wlr_gamma_control_manager_create( server->wl_display); diff --git a/rootston/meson.build b/rootston/meson.build index 1eb0704d..7ff79f8e 100644 --- a/rootston/meson.build +++ b/rootston/meson.build @@ -1,17 +1,20 @@ +sources = [ + 'config.c', + 'cursor.c', + 'desktop.c', + 'ini.c', + 'input.c', + 'keyboard.c', + 'main.c', + 'output.c', + 'pointer.c', + 'tablet_tool.c', + 'xdg_shell_v6.c', + 'wl_shell.c', +] +if get_option('enable_xwayland') + sources += ['xwayland.c'] +endif executable( - 'rootston', [ - 'config.c', - 'cursor.c', - 'desktop.c', - 'ini.c', - 'input.c', - 'keyboard.c', - 'main.c', - 'output.c', - 'pointer.c', - 'tablet_tool.c', - 'xdg_shell_v6.c', - 'xwayland.c', - 'wl_shell.c', - ], dependencies: wlroots + 'rootston', sources, dependencies: wlroots ) diff --git a/rootston/rootston.ini.example b/rootston/rootston.ini.example index 8ac474d4..460efa13 100644 --- a/rootston/rootston.ini.example +++ b/rootston/rootston.ini.example @@ -1,3 +1,7 @@ +[core] +# Disable X11 support. Enabled by default. +xwayland=false + # Single output configuration. String after semicolon must match output's name. [output:VGA-1] # Set logical (layout) coordinates for this screen |