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 /swaybar/bar.c | |
parent | Merge pull request #2835 from RyanDwyer/swap-crash (diff) | |
parent | Sway clients: Exit gracefully when compositor is unavailable (diff) | |
download | sway-f6ad4908bc2f366ccbee18889ffe35c7ee436389.tar.gz sway-f6ad4908bc2f366ccbee18889ffe35c7ee436389.tar.zst sway-f6ad4908bc2f366ccbee18889ffe35c7ee436389.zip |
Merge pull request #2838 from RyanDwyer/compositor-unavailable-crash
Sway clients: Exit gracefully when compositor is unavailable
Diffstat (limited to 'swaybar/bar.c')
-rw-r--r-- | swaybar/bar.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/swaybar/bar.c b/swaybar/bar.c index be290c18..0deba72d 100644 --- a/swaybar/bar.c +++ b/swaybar/bar.c | |||
@@ -586,7 +586,11 @@ bool bar_setup(struct swaybar *bar, const char *socket_path) { | |||
586 | } | 586 | } |
587 | 587 | ||
588 | bar->display = wl_display_connect(NULL); | 588 | bar->display = wl_display_connect(NULL); |
589 | assert(bar->display); | 589 | if (!bar->display) { |
590 | sway_abort("Unable to connect to the compositor. " | ||
591 | "If your compositor is running, check or set the " | ||
592 | "WAYLAND_DISPLAY environment variable."); | ||
593 | } | ||
590 | 594 | ||
591 | struct wl_registry *registry = wl_display_get_registry(bar->display); | 595 | struct wl_registry *registry = wl_display_get_registry(bar->display); |
592 | wl_registry_add_listener(registry, ®istry_listener, bar); | 596 | wl_registry_add_listener(registry, ®istry_listener, bar); |