aboutsummaryrefslogtreecommitdiff
path: root/include/wlr
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-12-09 15:43:19 +0100
committerSimon Ser <contact@emersion.fr>2021-12-09 15:46:46 +0100
commit36a2b19485ad299ee0039eb97c0f688d68205539 (patch)
tree73e9cd16a35925282fc41e1221c802d5175600be /include/wlr
parent1fbd13ec799c472558aef37436367f0e947f7d89 (diff)
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.
Diffstat (limited to 'include/wlr')
-rw-r--r--include/wlr/types/wlr_output.h13
1 files changed, 12 insertions, 1 deletions
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.