cmd_xwayland: add force for immediate launch

This just adds a force option to cmd_xwayland that allows for xwayland
to be immediately launched instead of lazily launched. This is useful
for slower machines so it can be part of the startup time instead of
when the user is actively trying to use it
This commit is contained in:
Brian Ashworth 2019-08-15 03:00:14 -04:00 committed by Drew DeVault
parent 384afc5cb5
commit ff7d979d99
5 changed files with 27 additions and 8 deletions

View file

@ -167,10 +167,12 @@ void server_fini(struct sway_server *server) {
bool server_start(struct sway_server *server) {
#if HAVE_XWAYLAND
if (config->xwayland) {
sway_log(SWAY_DEBUG, "Initializing Xwayland");
if (config->xwayland != XWAYLAND_MODE_DISABLED) {
sway_log(SWAY_DEBUG, "Initializing Xwayland (lazy=%d)",
config->xwayland == XWAYLAND_MODE_LAZY);
server->xwayland.wlr_xwayland =
wlr_xwayland_create(server->wl_display, server->compositor, true);
wlr_xwayland_create(server->wl_display, server->compositor,
config->xwayland == XWAYLAND_MODE_LAZY);
wl_signal_add(&server->xwayland.wlr_xwayland->events.new_surface,
&server->xwayland_surface);
server->xwayland_surface.notify = handle_xwayland_surface;