diff options
author | 2018-05-16 12:29:30 +0900 | |
---|---|---|
committer | 2018-05-16 16:50:56 +0900 | |
commit | 89ae1792b58a1a29afce7e00da06593187297459 (patch) | |
tree | 770f7f47574311c5ee91f8217defb4e6ba0a41a4 /sway/server.c | |
parent | swayidle: terminate if wl_display_dispatch failed (diff) | |
download | sway-89ae1792b58a1a29afce7e00da06593187297459.tar.gz sway-89ae1792b58a1a29afce7e00da06593187297459.tar.zst sway-89ae1792b58a1a29afce7e00da06593187297459.zip |
sway: run commands without waiting for Xwayland
Xwayland is lazy now, there is no need to wait at all
Diffstat (limited to 'sway/server.c')
-rw-r--r-- | sway/server.c | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/sway/server.c b/sway/server.c index 050ddf56..e47cc5b6 100644 --- a/sway/server.c +++ b/sway/server.c | |||
@@ -19,27 +19,11 @@ | |||
19 | #include <wlr/util/log.h> | 19 | #include <wlr/util/log.h> |
20 | // TODO WLR: make Xwayland optional | 20 | // TODO WLR: make Xwayland optional |
21 | #include <wlr/xwayland.h> | 21 | #include <wlr/xwayland.h> |
22 | #include "sway/commands.h" | ||
23 | #include "sway/config.h" | 22 | #include "sway/config.h" |
24 | #include "sway/input/input-manager.h" | 23 | #include "sway/input/input-manager.h" |
25 | #include "sway/server.h" | 24 | #include "sway/server.h" |
26 | #include "sway/tree/layout.h" | 25 | #include "sway/tree/layout.h" |
27 | 26 | ||
28 | static void server_ready(struct wl_listener *listener, void *data) { | ||
29 | wlr_log(L_DEBUG, "Compositor is ready, executing cmds in queue"); | ||
30 | // Execute commands until there are none left | ||
31 | config->active = true; | ||
32 | while (config->cmd_queue->length) { | ||
33 | char *line = config->cmd_queue->items[0]; | ||
34 | struct cmd_results *res = execute_command(line, NULL); | ||
35 | if (res->status != CMD_SUCCESS) { | ||
36 | wlr_log(L_ERROR, "Error on line '%s': %s", line, res->error); | ||
37 | } | ||
38 | free_cmd_results(res); | ||
39 | free(line); | ||
40 | list_del(config->cmd_queue, 0); | ||
41 | } | ||
42 | } | ||
43 | 27 | ||
44 | bool server_init(struct sway_server *server) { | 28 | bool server_init(struct sway_server *server) { |
45 | wlr_log(L_DEBUG, "Initializing Wayland server"); | 29 | wlr_log(L_DEBUG, "Initializing Wayland server"); |
@@ -93,10 +77,6 @@ bool server_init(struct sway_server *server) { | |||
93 | wl_signal_add(&server->xwayland->events.new_surface, | 77 | wl_signal_add(&server->xwayland->events.new_surface, |
94 | &server->xwayland_surface); | 78 | &server->xwayland_surface); |
95 | server->xwayland_surface.notify = handle_xwayland_surface; | 79 | server->xwayland_surface.notify = handle_xwayland_surface; |
96 | wl_signal_add(&server->xwayland->events.ready, | ||
97 | &server->xwayland_ready); | ||
98 | // TODO: call server_ready now if xwayland is not enabled | ||
99 | server->xwayland_ready.notify = server_ready; | ||
100 | 80 | ||
101 | // TODO: configurable cursor theme and size | 81 | // TODO: configurable cursor theme and size |
102 | server->xcursor_manager = wlr_xcursor_manager_create(NULL, 24); | 82 | server->xcursor_manager = wlr_xcursor_manager_create(NULL, 24); |