compositor-wayland: clarify wl_display_connect() error
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>
Mon, 23 Oct 2017 09:03:38 +0000 (12:03 +0300)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Tue, 24 Oct 2017 09:51:35 +0000 (12:51 +0300)
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@collabora.co.uk>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Acked-by: Daniel Stone <daniels@collabora.com>
libweston/compositor-wayland.c

index d27b863..bc78cbd 100644 (file)
@@ -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;
        }