[PATCH weston 08/10] compositor-wayland: clarify wl_display_connect() error

Pekka Paalanen ppaalanen at gmail.com
Tue Oct 24 10:16:05 UTC 2017


From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>

Clarify the error message to explicitly say one was trying to connect to
a parent Wayland compositor. This hopefully is a good enough hint on
what using the wayland-backend is trying to do.

Add the command line display option value and WAYLAND_DISPLAY values for
good measure. WAYLAND_SOCKET is not shown as libwayland-client removes
it.

Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
---
 libweston/compositor-wayland.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libweston/compositor-wayland.c b/libweston/compositor-wayland.c
index d27b863f..bc78cbdb 100644
--- a/libweston/compositor-wayland.c
+++ b/libweston/compositor-wayland.c
@@ -2541,7 +2541,10 @@ wayland_backend_create(struct weston_compositor *compositor,
 
 	b->parent.wl_display = wl_display_connect(new_config->display_name);
 	if (b->parent.wl_display == NULL) {
-		weston_log("failed to create display: %m\n");
+		weston_log("Error: Failed to connect to parent Wayland compositor: %m\n");
+		weston_log_continue(STAMP_SPACE "display option: %s, WAYLAND_DISPLAY=%s\n",
+				    new_config->display_name ?: "(none)",
+				    getenv("WAYLAND_DISPLAY") ?: "(not set)");
 		goto err_compositor;
 	}
 
-- 
2.13.6



More information about the wayland-devel mailing list