aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2019-12-26 16:09:05 +0100
committerBrian Ashworth <bosrsf04@gmail.com>2019-12-29 12:35:22 -0500
commit4da4a15d6bfa8d4b92d1ac4605ea78893da3fab0 (patch)
tree9466504b4ac0c193c1fbd597ac1bab61f588833b /backend
parenta420d2c41ef3f001afb806d13e31a2e21502d76f (diff)
output: add description
wlr_output.description is a string containing a human-readable string identifying the output. Compositors can customise it via wlr_output_set_description, for instance to make the name more user-friendly. References: https://github.com/swaywm/wlroots/issues/1623
Diffstat (limited to 'backend')
-rw-r--r--backend/drm/drm.c6
-rw-r--r--backend/headless/output.c5
-rw-r--r--backend/rdp/output.c5
-rw-r--r--backend/wayland/output.c5
-rw-r--r--backend/x11/output.c5
5 files changed, 26 insertions, 0 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index 5e7369fd..a4f22590 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -1348,6 +1348,12 @@ void scan_drm_connectors(struct wlr_drm_backend *drm) {
parse_edid(&wlr_conn->output, edid_len, edid);
free(edid);
+ struct wlr_output *output = &wlr_conn->output;
+ char description[128];
+ snprintf(description, sizeof(description), "%s %s %s (%s)",
+ output->make, output->model, output->serial, output->name);
+ wlr_output_set_description(output, description);
+
wlr_log(WLR_INFO, "Detected modes:");
for (int i = 0; i < drm_conn->count_modes; ++i) {
diff --git a/backend/headless/output.c b/backend/headless/output.c
index 992a4883..add00f76 100644
--- a/backend/headless/output.c
+++ b/backend/headless/output.c
@@ -121,6 +121,11 @@ struct wlr_output *wlr_headless_add_output(struct wlr_backend *wlr_backend,
snprintf(wlr_output->name, sizeof(wlr_output->name), "HEADLESS-%zd",
++backend->last_output_num);
+ char description[128];
+ snprintf(description, sizeof(description),
+ "Headless output %zd", backend->last_output_num);
+ wlr_output_set_description(wlr_output, description);
+
if (!wlr_egl_make_current(&output->backend->egl, output->egl_surface,
NULL)) {
goto error;
diff --git a/backend/rdp/output.c b/backend/rdp/output.c
index 45eba3aa..302a99de 100644
--- a/backend/rdp/output.c
+++ b/backend/rdp/output.c
@@ -278,6 +278,11 @@ struct wlr_rdp_output *wlr_rdp_output_create(struct wlr_rdp_backend *backend,
snprintf(wlr_output->name, sizeof(wlr_output->name), "RDP-%d",
wl_list_length(&backend->clients));
+ char description[128];
+ snprintf(description, sizeof(description),
+ "RDP output %d", wl_list_length(&backend->clients));
+ wlr_output_set_description(wlr_output, description);
+
if (!wlr_egl_make_current(&output->backend->egl, output->egl_surface,
NULL)) {
goto error;
diff --git a/backend/wayland/output.c b/backend/wayland/output.c
index 5d3a5ff5..adff43af 100644
--- a/backend/wayland/output.c
+++ b/backend/wayland/output.c
@@ -458,6 +458,11 @@ struct wlr_output *wlr_wl_output_create(struct wlr_backend *wlr_backend) {
snprintf(wlr_output->name, sizeof(wlr_output->name), "WL-%zd",
++backend->last_output_num);
+ char description[128];
+ snprintf(description, sizeof(description),
+ "Wayland output %zd", backend->last_output_num);
+ wlr_output_set_description(wlr_output, description);
+
output->backend = backend;
wl_list_init(&output->presentation_feedbacks);
diff --git a/backend/x11/output.c b/backend/x11/output.c
index 1307f785..b6d00852 100644
--- a/backend/x11/output.c
+++ b/backend/x11/output.c
@@ -149,6 +149,11 @@ struct wlr_output *wlr_x11_output_create(struct wlr_backend *backend) {
++x11->last_output_num);
parse_xcb_setup(wlr_output, x11->xcb);
+ char description[128];
+ snprintf(description, sizeof(description),
+ "X11 output %zd", x11->last_output_num);
+ wlr_output_set_description(wlr_output, description);
+
uint32_t mask = XCB_CW_EVENT_MASK;
uint32_t values[] = {
XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_STRUCTURE_NOTIFY