mirror of
https://github.com/swaywm/sway.git
synced 2024-11-04 23:43:14 +00:00
Implement create_output command for headless backend
This commit is contained in:
parent
b18d943442
commit
b300bace0f
|
@ -1,4 +1,5 @@
|
||||||
#include <wlr/config.h>
|
#include <wlr/config.h>
|
||||||
|
#include <wlr/backend/headless.h>
|
||||||
#include <wlr/backend/multi.h>
|
#include <wlr/backend/multi.h>
|
||||||
#include <wlr/backend/wayland.h>
|
#include <wlr/backend/wayland.h>
|
||||||
#if WLR_HAS_X11_BACKEND
|
#if WLR_HAS_X11_BACKEND
|
||||||
|
@ -17,6 +18,9 @@ static void create_output(struct wlr_backend *backend, void *data) {
|
||||||
if (wlr_backend_is_wl(backend)) {
|
if (wlr_backend_is_wl(backend)) {
|
||||||
wlr_wl_output_create(backend);
|
wlr_wl_output_create(backend);
|
||||||
*done = true;
|
*done = true;
|
||||||
|
} else if (wlr_backend_is_headless(backend)) {
|
||||||
|
wlr_headless_add_output(backend, 1920, 1080);
|
||||||
|
*done = true;
|
||||||
}
|
}
|
||||||
#if WLR_HAS_X11_BACKEND
|
#if WLR_HAS_X11_BACKEND
|
||||||
else if (wlr_backend_is_x11(backend)) {
|
else if (wlr_backend_is_x11(backend)) {
|
||||||
|
@ -38,7 +42,7 @@ struct cmd_results *cmd_create_output(int argc, char **argv) {
|
||||||
|
|
||||||
if (!done) {
|
if (!done) {
|
||||||
return cmd_results_new(CMD_INVALID,
|
return cmd_results_new(CMD_INVALID,
|
||||||
"Can only create outputs for Wayland or X11 backends");
|
"Can only create outputs for Wayland, X11 or headless backends");
|
||||||
}
|
}
|
||||||
|
|
||||||
return cmd_results_new(CMD_SUCCESS, NULL);
|
return cmd_results_new(CMD_SUCCESS, NULL);
|
||||||
|
|
Loading…
Reference in a new issue