[PATCH] compositor: Use libwayland to find a good default display for us

Jasper St. Pierre jstpierre at mecheye.net
Wed May 7 07:25:55 PDT 2014


---
 src/compositor.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/compositor.c b/src/compositor.c
index 3d65e4c..1906441 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -4150,7 +4150,7 @@ int main(int argc, char *argv[])
 	char *server_socket = NULL, *end;
 	int32_t idle_time = 300;
 	int32_t help = 0;
-	char *socket_name = "wayland-0";
+	char *socket_name = NULL;
 	int32_t version = 0;
 	struct weston_config *config;
 	struct weston_config_section *section;
@@ -4245,6 +4245,9 @@ int main(int argc, char *argv[])
 	ec->idle_time = idle_time;
 	ec->default_pointer_grab = NULL;
 
+	if (socket_name == NULL)
+		socket_name = wl_choose_default_display();
+
 	setenv("WAYLAND_DISPLAY", socket_name, 1);
 
 	if (option_shell)
-- 
1.9.0



More information about the wayland-devel mailing list