diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-10-15 21:57:59 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-10-15 21:57:59 +1000 |
commit | d6a4c6f9638e66ea951f3d163a29c55c2e28d016 (patch) | |
tree | 26506c161975e5fa0effb77fa0b737c749d42054 | |
parent | 363dfeed1351375fc1d1f5ef542a02620ae22dd7 (diff) | |
download | swaybg-d6a4c6f9638e66ea951f3d163a29c55c2e28d016.tar.gz swaybg-d6a4c6f9638e66ea951f3d163a29c55c2e28d016.tar.bz2 |
Sway clients: Exit gracefully when compositor is unavailable
-rw-r--r-- | main.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -222,7 +222,12 @@ int main(int argc, const char **argv) { } state.display = wl_display_connect(NULL); - assert(state.display); + if (!state.display) { + wlr_log(WLR_ERROR, "Unable to connect to the compositor. " + "If your compositor is running, check or set the " + "WAYLAND_DISPLAY environment variable."); + return 1; + } struct wl_registry *registry = wl_display_get_registry(state.display); wl_registry_add_listener(registry, ®istry_listener, &state); |