aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Dominique Martinet <asmadeus@codewreck.org>2018-07-04 13:50:23 +0900
committerLibravatar Dominique Martinet <asmadeus@codewreck.org>2018-07-04 13:52:26 +0900
commitc092f1fe6a742bc79015efe6e485c35f49cbf473 (patch)
tree55272d0cb9f32a18b671b049336841024c10c0fa
parentMerge pull request #2194 from RyanDwyer/fix-incorrect-render (diff)
downloadsway-c092f1fe6a742bc79015efe6e485c35f49cbf473.tar.gz
sway-c092f1fe6a742bc79015efe6e485c35f49cbf473.tar.zst
sway-c092f1fe6a742bc79015efe6e485c35f49cbf473.zip
startup: move setenv WAYLAND_DISPLAY before config execs
We would previously run all config commands without the environment, which would appear to work as our socket name is the default one, but wayland clients would start up in the wrong sway session. (This explains why 'sometimes' my swayidle processes wouldn't die with sway, as they weren't listening to the correct socket)
-rw-r--r--sway/main.c1
-rw-r--r--sway/server.c1
2 files changed, 1 insertions, 1 deletions
diff --git a/sway/main.c b/sway/main.c
index 124f9fbb..8b0b8612 100644
--- a/sway/main.c
+++ b/sway/main.c
@@ -416,6 +416,7 @@ int main(int argc, char **argv) {
416 security_sanity_check(); 416 security_sanity_check();
417 417
418 config->active = true; 418 config->active = true;
419 setenv("WAYLAND_DISPLAY", server.socket, true);
419 // Execute commands until there are none left 420 // Execute commands until there are none left
420 while (config->cmd_queue->length) { 421 while (config->cmd_queue->length) {
421 char *line = config->cmd_queue->items[0]; 422 char *line = config->cmd_queue->items[0];
diff --git a/sway/server.c b/sway/server.c
index 8106f3c8..cd15f454 100644
--- a/sway/server.c
+++ b/sway/server.c
@@ -143,7 +143,6 @@ void server_fini(struct sway_server *server) {
143void server_run(struct sway_server *server) { 143void server_run(struct sway_server *server) {
144 wlr_log(L_INFO, "Running compositor on wayland display '%s'", 144 wlr_log(L_INFO, "Running compositor on wayland display '%s'",
145 server->socket); 145 server->socket);
146 setenv("WAYLAND_DISPLAY", server->socket, true);
147 if (!wlr_backend_start(server->backend)) { 146 if (!wlr_backend_start(server->backend)) {
148 wlr_log(L_ERROR, "Failed to start backend"); 147 wlr_log(L_ERROR, "Failed to start backend");
149 wlr_backend_destroy(server->backend); 148 wlr_backend_destroy(server->backend);