From 9dee9ed7bb825133f78661737615d3c9f1ec76ef Mon Sep 17 00:00:00 2001 From: Quantum Date: Sun, 10 Jul 2022 00:01:10 -0400 Subject: [PATCH] [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 --- client/src/main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/src/main.c b/client/src/main.c index 5087e71e..7a9e9767 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -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)