compositor: Set WAYLAND_DISPLAY if we're given a --socket argument
This lets us run multiple compositors (nested or on different VTs).
https://bugs.freedesktop.org/show_bug.cgi?id=46629
diff --git a/src/compositor.c b/src/compositor.c
index bd2a0d2..97efcaf 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -3536,6 +3536,8 @@
config_file = config_file_path("weston.ini");
parse_config_file(config_file, cs, ARRAY_LENGTH(cs), shell);
+ if (socket_name)
+ setenv("WAYLAND_DISPLAY", socket_name, 1);
backend_init = load_module(backend, "backend_init", &backend_module);
if (!backend_init)