frontend: don't require XDG_RUNTIME_DIR

Recent versions of libwayland support absolute paths in display names,
and in that case do not require XDG_RUNTIME_DIR to be set.  It's
therefore overly strict for Weston to exit due to XDG_RUNTIME_DIR being
unset when it would work perfectly fine without it.  The messages
displayed for incorrectly set XDG_RUNTIME_DIR are useful though, so keep
them around, but only display them if wl_display_add_socket() fails
i.e. the lack of XDG_RUNTIME_DIR has actually caused a problem.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
This commit is contained in:
Alyssa Ross 2025-12-08 02:08:56 +01:00 committed by Pekka Paalanen
parent 85315c4841
commit 54217f5d88

View file

@ -960,6 +960,9 @@ weston_create_listening_socket(struct wl_display *display, const char *socket_na
if (socket_name) {
if (wl_display_add_socket(display, socket_name)) {
if (socket_name[0] != '/')
verify_xdg_runtime_dir();
weston_log("fatal: failed to add socket: %s\n",
strerror(errno));
return -1;
@ -5415,7 +5418,6 @@ wet_main(int argc, char *argv[], const struct weston_testsuite_data *test_data)
weston_log_continue(", scopes subscribed: %s", flight_rec_scopes);
weston_log_continue("\n");
verify_xdg_runtime_dir();
display = wl_display_create();
if (display == NULL) {