diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-10-15 15:37:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-15 15:37:17 +0200 |
commit | f6ad4908bc2f366ccbee18889ffe35c7ee436389 (patch) | |
tree | 8fb3b25e4e244bf32ddb4a27ecaffce9661a13c5 /swaybg | |
parent | 97b9452171f2532831a876167fe93c71541d644d (diff) | |
parent | 32ba8154b8f5f15b2c778dd404f3acb5becc1719 (diff) | |
download | sway-f6ad4908bc2f366ccbee18889ffe35c7ee436389.tar.xz |
Merge pull request #2838 from RyanDwyer/compositor-unavailable-crash
Sway clients: Exit gracefully when compositor is unavailable
Diffstat (limited to 'swaybg')
-rw-r--r-- | swaybg/main.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/swaybg/main.c b/swaybg/main.c index 742669ef..45b7a913 100644 --- a/swaybg/main.c +++ b/swaybg/main.c @@ -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); |