mirror of
https://github.com/swaywm/sway.git
synced 2025-10-29 05:40:18 -04:00
Sway clients: Exit gracefully when compositor is unavailable
This commit is contained in:
parent
56c388b510
commit
32ba8154b8
5 changed files with 24 additions and 5 deletions
|
|
@ -586,7 +586,11 @@ bool bar_setup(struct swaybar *bar, const char *socket_path) {
|
|||
}
|
||||
|
||||
bar->display = wl_display_connect(NULL);
|
||||
assert(bar->display);
|
||||
if (!bar->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(bar->display);
|
||||
wl_registry_add_listener(registry, ®istry_listener, bar);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue