diff options
Diffstat (limited to 'backend/backend.c')
-rw-r--r-- | backend/backend.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/backend/backend.c b/backend/backend.c index b369a135..33ad20f2 100644 --- a/backend/backend.c +++ b/backend/backend.c @@ -11,6 +11,7 @@ #include <wlr/backend/interface.h> #include <wlr/backend/libinput.h> #include <wlr/backend/multi.h> +#include <wlr/backend/noop.h> #include <wlr/backend/session.h> #include <wlr/backend/wayland.h> #include <wlr/config.h> @@ -133,6 +134,20 @@ static struct wlr_backend *attempt_headless_backend( return backend; } +static struct wlr_backend *attempt_noop_backend(struct wl_display *display) { + struct wlr_backend *backend = wlr_noop_backend_create(display); + if (backend == NULL) { + return NULL; + } + + size_t outputs = parse_outputs_env("WLR_NOOP_OUTPUTS"); + for (size_t i = 0; i < outputs; ++i) { + wlr_noop_add_output(backend); + } + + return backend; +} + static struct wlr_backend *attempt_drm_backend(struct wl_display *display, struct wlr_backend *backend, struct wlr_session *session, wlr_renderer_create_func_t create_renderer_func) { @@ -170,6 +185,8 @@ static struct wlr_backend *attempt_backend_by_name(struct wl_display *display, #endif } else if (strcmp(name, "headless") == 0) { return attempt_headless_backend(display, create_renderer_func); + } else if (strcmp(name, "noop") == 0) { + return attempt_noop_backend(display); } else if (strcmp(name, "drm") == 0 || strcmp(name, "libinput") == 0) { // DRM and libinput need a session if (!*session) { |