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. --- include/wlr/types/wlr_output.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'include/wlr') diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h index fd8e6556..791023d2 100644 --- a/include/wlr/types/wlr_output.h +++ b/include/wlr/types/wlr_output.h @@ -118,7 +118,7 @@ struct wlr_output { struct wl_global *global; struct wl_list resources; - char name[24]; + char *name; char *description; // may be NULL char make[56]; char model[16]; @@ -336,6 +336,17 @@ void wlr_output_set_render_format(struct wlr_output *output, uint32_t format); void wlr_output_set_scale(struct wlr_output *output, float scale); void wlr_output_set_subpixel(struct wlr_output *output, enum wl_output_subpixel subpixel); +/** + * Set the output name. + * + * Output names are subject to the following rules: + * + * - Each output name must be unique. + * - The name cannot change after the output has been advertised to clients. + * + * For more details, see the protocol documentation for wl_output.name. + */ +void wlr_output_set_name(struct wlr_output *output, const char *name); void wlr_output_set_description(struct wlr_output *output, const char *desc); /** * Schedule a done event. -- cgit v1.2.3