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 | 529f5ce2e4445134999f2b43a82580639441b70d (patch) | |
| tree | 3cf7f854c4e8b6183a4f4f8f7fbb2769ac1cc139 | |
| parent | a59fa9d1b6a22cdbad855b810d57b11c7072c840 (diff) | |
Sway clients: Exit gracefully when compositor is unavailable
| -rw-r--r-- | main.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -908,7 +908,11 @@ int main(int argc, char **argv) { wl_list_init(&state.surfaces); state.xkb.context = xkb_context_new(XKB_CONTEXT_NO_FLAGS); state.display = wl_display_connect(NULL); - assert(state.display); + if (!state.display) { + sway_abort("Unable to connect to the compositor. " + "If your compositor is running, check or set the " + "WAYLAND_DISPLAY environment variable."); + } struct wl_registry *registry = wl_display_get_registry(state.display); wl_registry_add_listener(registry, ®istry_listener, &state); |
