diff options
author | Vincent Vanlaer <vincent.vanlaer@skynet.be> | 2018-05-06 22:51:32 +0200 |
---|---|---|
committer | Vincent Vanlaer <vincent.vanlaer@skynet.be> | 2018-05-06 23:41:29 +0200 |
commit | dbf4f9a2312c378b855db68f18b922e73c746887 (patch) | |
tree | 77cbed95050095fbe5bdee49305a301223e1b074 /rootston/main.c | |
parent | 31861b3a7a2a4f3dc278278dadec60a70138c74e (diff) |
Make startup command no longer wait for xwayland
Diffstat (limited to 'rootston/main.c')
-rw-r--r-- | rootston/main.c | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/rootston/main.c b/rootston/main.c index a61d65c9..18d27a8a 100644 --- a/rootston/main.c +++ b/rootston/main.c @@ -14,18 +14,6 @@ struct roots_server server = { 0 }; -static void ready(struct wl_listener *listener, void *data) { - if (server.config->startup_cmd != NULL) { - const char *cmd = server.config->startup_cmd; - pid_t pid = fork(); - if (pid < 0) { - wlr_log(L_ERROR, "cannot execute binding command: fork() failed"); - } else if (pid == 0) { - execl("/bin/sh", "/bin/sh", "-c", cmd, (void *)NULL); - } - } -} - int main(int argc, char **argv) { wlr_log_init(L_DEBUG, NULL); server.config = roots_config_create_from_args(argc, argv); @@ -65,21 +53,24 @@ int main(int argc, char **argv) { } setenv("WAYLAND_DISPLAY", socket, true); -#ifndef WLR_HAS_XWAYLAND - ready(NULL, NULL); -#else +#ifdef WLR_HAS_XWAYLAND if (server.desktop->xwayland != NULL) { struct roots_seat *xwayland_seat = input_get_seat(server.input, ROOTS_CONFIG_DEFAULT_SEAT_NAME); wlr_xwayland_set_seat(server.desktop->xwayland, xwayland_seat->seat); - wl_signal_add(&server.desktop->xwayland->events.ready, - &server.desktop->xwayland_ready); - server.desktop->xwayland_ready.notify = ready; - } else { - ready(NULL, NULL); } #endif + if (server.config->startup_cmd != NULL) { + const char *cmd = server.config->startup_cmd; + pid_t pid = fork(); + if (pid < 0) { + wlr_log(L_ERROR, "cannot execute binding command: fork() failed"); + } else if (pid == 0) { + execl("/bin/sh", "/bin/sh", "-c", cmd, (void *)NULL); + } + } + wl_display_run(server.wl_display); wl_display_destroy(server.wl_display); return 0; |