aboutsummaryrefslogtreecommitdiff
path: root/swaylock
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-10-15 15:37:17 +0200
committerGitHub <noreply@github.com>2018-10-15 15:37:17 +0200
commitf6ad4908bc2f366ccbee18889ffe35c7ee436389 (patch)
tree8fb3b25e4e244bf32ddb4a27ecaffce9661a13c5 /swaylock
parent97b9452171f2532831a876167fe93c71541d644d (diff)
parent32ba8154b8f5f15b2c778dd404f3acb5becc1719 (diff)
Merge pull request #2838 from RyanDwyer/compositor-unavailable-crash
Sway clients: Exit gracefully when compositor is unavailable
Diffstat (limited to 'swaylock')
-rw-r--r--swaylock/main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/swaylock/main.c b/swaylock/main.c
index 27bcfe32..04c0bb07 100644
--- a/swaylock/main.c
+++ b/swaylock/main.c
@@ -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, &registry_listener, &state);