From 36a2b19485ad299ee0039eb97c0f688d68205539 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 9 Dec 2021 15:43:19 +0100 Subject: output: introduce wlr_output_set_name wlroots picks names for all outputs, but it might be desirable for compositor to override it. For instance, Sway will use a headless output as a fallback in case no outputs are connected. Sway wants to clearly label the fallback output as such and label "real" headless outputs starting from HEADLESS-1. --- backend/headless/output.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'backend/headless/output.c') diff --git a/backend/headless/output.c b/backend/headless/output.c index 50d914e4..fbec8110 100644 --- a/backend/headless/output.c +++ b/backend/headless/output.c @@ -116,8 +116,10 @@ struct wlr_output *wlr_headless_add_output(struct wlr_backend *wlr_backend, output_set_custom_mode(output, width, height, 0); strncpy(wlr_output->make, "headless", sizeof(wlr_output->make)); strncpy(wlr_output->model, "headless", sizeof(wlr_output->model)); - snprintf(wlr_output->name, sizeof(wlr_output->name), "HEADLESS-%zd", - ++backend->last_output_num); + + char name[64]; + snprintf(name, sizeof(name), "HEADLESS-%zd", ++backend->last_output_num); + wlr_output_set_name(wlr_output, name); char description[128]; snprintf(description, sizeof(description), -- cgit v1.2.3