mirror of
https://github.com/swaywm/sway.git
synced 2026-04-29 06:46:22 -04:00
Use the env var for finding a socket.
This commit is contained in:
parent
d19648a304
commit
513398253e
1 changed files with 9 additions and 2 deletions
|
|
@ -141,8 +141,15 @@ bool server_init(struct sway_server *server) {
|
||||||
wlr_export_dmabuf_manager_v1_create(server->wl_display);
|
wlr_export_dmabuf_manager_v1_create(server->wl_display);
|
||||||
wlr_screencopy_manager_v1_create(server->wl_display);
|
wlr_screencopy_manager_v1_create(server->wl_display);
|
||||||
|
|
||||||
server->socket = wl_display_add_socket_auto(server->wl_display);
|
server->socket = getenv("WAYLAND_DISPLAY");
|
||||||
if (!server->socket) {
|
int ret = 0;
|
||||||
|
if (server->socket) {
|
||||||
|
ret = wl_display_add_socket(server->wl_display, server->socket);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
server->socket = wl_display_add_socket_auto(server->wl_display);
|
||||||
|
}
|
||||||
|
if (ret < 0 || !server->socket) {
|
||||||
wlr_log(WLR_ERROR, "Unable to open wayland socket");
|
wlr_log(WLR_ERROR, "Unable to open wayland socket");
|
||||||
wlr_backend_destroy(server->backend);
|
wlr_backend_destroy(server->backend);
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue