1
0
Fork 0
mirror of https://github.com/Cloudef/bemenu synced 2024-06-13 04:56:47 +02:00

Make renderers try detect whether they are in correct env.

This commit is contained in:
Jari Vetoniemi 2015-03-09 09:53:57 +02:00
parent bf5fd83491
commit d8097c44dd
2 changed files with 6 additions and 0 deletions

View File

@ -184,6 +184,9 @@ destructor(struct bm_menu *menu)
static bool
constructor(struct bm_menu *menu)
{
if (!getenv("WAYLAND_DISPLAY") && !getenv("WAYLAND_SOCKET"))
return false;
struct wayland *wayland;
if (!(menu->renderer->internal = wayland = calloc(1, sizeof(struct wayland))))
goto fail;

View File

@ -200,6 +200,9 @@ destructor(struct bm_menu *menu)
static bool
constructor(struct bm_menu *menu)
{
if (getenv("WAYLAND_DISPLAY") || getenv("WAYLAND_SOCKET"))
return false;
struct x11 *x11;
if (!(menu->renderer->internal = x11 = calloc(1, sizeof(struct x11))))
goto fail;