Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement create_output command for headless backend #5215

Merged
merged 1 commit into from
Apr 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion sway/commands/create_output.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <wlr/config.h>
#include <wlr/backend/headless.h>
#include <wlr/backend/multi.h>
#include <wlr/backend/wayland.h>
#if WLR_HAS_X11_BACKEND
Expand All @@ -17,6 +18,9 @@ static void create_output(struct wlr_backend *backend, void *data) {
if (wlr_backend_is_wl(backend)) {
wlr_wl_output_create(backend);
*done = true;
} else if (wlr_backend_is_headless(backend)) {
wlr_headless_add_output(backend, 1920, 1080);
*done = true;
}
#if WLR_HAS_X11_BACKEND
else if (wlr_backend_is_x11(backend)) {
Expand All @@ -38,7 +42,7 @@ struct cmd_results *cmd_create_output(int argc, char **argv) {

if (!done) {
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);
Expand Down