From 32ba8154b8f5f15b2c778dd404f3acb5becc1719 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Mon, 15 Oct 2018 21:57:59 +1000 Subject: Sway clients: Exit gracefully when compositor is unavailable --- swaynag/swaynag.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'swaynag/swaynag.c') diff --git a/swaynag/swaynag.c b/swaynag/swaynag.c index 69da851e..fa6bbe05 100644 --- a/swaynag/swaynag.c +++ b/swaynag/swaynag.c @@ -342,7 +342,11 @@ static const struct wl_registry_listener registry_listener = { void swaynag_setup(struct swaynag *swaynag) { swaynag->display = wl_display_connect(NULL); - assert(swaynag->display); + if (!swaynag->display) { + sway_abort("Unable to connect to the compositor. " + "If your compositor is running, check or set the " + "WAYLAND_DISPLAY environment variable."); + } swaynag->scale = 1; wl_list_init(&swaynag->outputs); -- cgit v1.2.3