aboutsummaryrefslogtreecommitdiff
path: root/backend/x11
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 /backend/x11
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 'backend/x11')
-rw-r--r--backend/x11/output.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/backend/x11/output.c b/backend/x11/output.c
index 9081769e..25194e70 100644
--- a/backend/x11/output.c
+++ b/backend/x11/output.c
@@ -512,8 +512,10 @@ struct wlr_output *wlr_x11_output_create(struct wlr_backend *backend) {
wlr_output_update_custom_mode(wlr_output, 1024, 768, 0);
- snprintf(wlr_output->name, sizeof(wlr_output->name), "X11-%zd",
- ++x11->last_output_num);
+ char name[64];
+ snprintf(name, sizeof(name), "X11-%zd", ++x11->last_output_num);
+ wlr_output_set_name(wlr_output, name);
+
parse_xcb_setup(wlr_output, x11->xcb);
char description[128];