[client] main: better error when no display server is available

This commit makes it show a prettier error message when no display
server is available, including the display servers compiled. This
replaces the old assert.

Example output:

[E] 572277145932              main.c:1167 | lg_run                         | No display servers available, tried:
[E] 572277145934              main.c:1169 | lg_run                         | * Wayland
[E] 572277145935              main.c:1169 | lg_run                         | * X11
This commit is contained in:
Quantum 2022-07-10 00:01:10 -04:00 committed by Geoffrey McRae
parent 0dabfdc432
commit 9dee9ed7bb

View File

@ -1162,7 +1162,14 @@ static int lg_run(void)
break;
}
DEBUG_ASSERT(g_state.ds);
if (!g_state.ds)
{
DEBUG_ERROR("No display servers available, tried:");
for (int i = 0; i < LG_DISPLAYSERVER_COUNT; ++i)
DEBUG_ERROR("* %s", LG_DisplayServers[i]->name);
return -1;
}
ASSERT_LG_DS_VALID(g_state.ds);
if (g_params.jitRender)