mirror of
https://github.com/cage-kiosk/cage.git
synced 2025-10-29 05:40:19 -04:00
Cage: check if XDG_RUNTIME_DIR is set
Wayland requires this environment variable to be set, see https://manpages.debian.org/experimental/libwayland-doc/wl_display_connect.3.en.html
This commit is contained in:
parent
30d805d6ff
commit
a63c75c849
1 changed files with 6 additions and 0 deletions
6
cage.c
6
cage.c
|
|
@ -194,6 +194,12 @@ main(int argc, char *argv[])
|
||||||
wlr_log_init(WLR_ERROR, NULL);
|
wlr_log_init(WLR_ERROR, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Wayland requires XDG_RUNTIME_DIR to be set. */
|
||||||
|
if (!getenv("XDG_RUNTIME_DIR")) {
|
||||||
|
wlr_log(WLR_ERROR, "XDG_RUNTIME_DIR is not set in the environment");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
server.wl_display = wl_display_create();
|
server.wl_display = wl_display_create();
|
||||||
if (!server.wl_display) {
|
if (!server.wl_display) {
|
||||||
wlr_log(WLR_ERROR, "Cannot allocate a Wayland display");
|
wlr_log(WLR_ERROR, "Cannot allocate a Wayland display");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue