diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/renderers/wayland/wayland.c | 3 | ||||
| -rw-r--r-- | lib/renderers/x11/x11.c | 3 | 
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/renderers/wayland/wayland.c b/lib/renderers/wayland/wayland.c index c348c7a..12fd257 100644 --- a/lib/renderers/wayland/wayland.c +++ b/lib/renderers/wayland/wayland.c @@ -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; diff --git a/lib/renderers/x11/x11.c b/lib/renderers/x11/x11.c index 3e991c9..79adad8 100644 --- a/lib/renderers/x11/x11.c +++ b/lib/renderers/x11/x11.c @@ -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;  | 
