mirror of
https://github.com/swaywm/sway.git
synced 2024-11-30 03:41:27 +00:00
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)
This commit is contained in:
parent
8cc26130a6
commit
c092f1fe6a
|
@ -416,6 +416,7 @@ int main(int argc, char **argv) {
|
||||||
security_sanity_check();
|
security_sanity_check();
|
||||||
|
|
||||||
config->active = true;
|
config->active = true;
|
||||||
|
setenv("WAYLAND_DISPLAY", server.socket, true);
|
||||||
// Execute commands until there are none left
|
// Execute commands until there are none left
|
||||||
while (config->cmd_queue->length) {
|
while (config->cmd_queue->length) {
|
||||||
char *line = config->cmd_queue->items[0];
|
char *line = config->cmd_queue->items[0];
|
||||||
|
|
|
@ -143,7 +143,6 @@ void server_fini(struct sway_server *server) {
|
||||||
void server_run(struct sway_server *server) {
|
void server_run(struct sway_server *server) {
|
||||||
wlr_log(L_INFO, "Running compositor on wayland display '%s'",
|
wlr_log(L_INFO, "Running compositor on wayland display '%s'",
|
||||||
server->socket);
|
server->socket);
|
||||||
setenv("WAYLAND_DISPLAY", server->socket, true);
|
|
||||||
if (!wlr_backend_start(server->backend)) {
|
if (!wlr_backend_start(server->backend)) {
|
||||||
wlr_log(L_ERROR, "Failed to start backend");
|
wlr_log(L_ERROR, "Failed to start backend");
|
||||||
wlr_backend_destroy(server->backend);
|
wlr_backend_destroy(server->backend);
|
||||||
|
|
Loading…
Reference in a new issue