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
|
|
@ -342,7 +342,11 @@ static const struct wl_registry_listener registry_listener = {
|
|||
|
||||
void swaynag_setup(struct swaynag *swaynag) {
|
||||
swaynag->display = wl_display_connect(NULL);
|
||||
assert(swaynag->display);
|
||||
if (!swaynag->display) {
|
||||
sway_abort("Unable to connect to the compositor. "
|
||||
"If your compositor is running, check or set the "
|
||||
"WAYLAND_DISPLAY environment variable.");
|
||||
}
|
||||
|
||||
swaynag->scale = 1;
|
||||
wl_list_init(&swaynag->outputs);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue