/** Initialize a pre-allocated weston_head
*
* \param head The head to initialize.
+ * \param name The head name, e.g. the connector name or equivalent.
*
* The head will be safe to attach, detach and release.
*
+ * The name is used in logs, and can be used by compositors as a configuration
+ * identifier.
+ *
* \memberof weston_head
* \internal
*/
static void
-weston_head_init(struct weston_head *head)
+weston_head_init(struct weston_head *head, const char *name)
{
/* Add some (in)sane defaults which can be used
* for checking if an output was properly configured
wl_list_init(&head->output_link);
wl_list_init(&head->resource_list);
+ head->name = strdup(name);
}
/** Attach a head to an inactive output
free(head->make);
free(head->model);
free(head->serial_number);
+ free(head->name);
}
/** Store monitor make, model and serial number
wl_list_init(&output->head_list);
- weston_head_init(&output->head);
+ weston_head_init(&output->head, name);
/* Add some (in)sane defaults which can be used
* for checking if an output was properly configured
char *serial_number; /**< monitor serial */
uint32_t subpixel; /**< enum wl_output_subpixel */
bool connection_internal; /**< embedded monitor (e.g. laptop) */
+
+ char *name; /**< head name, e.g. connector name */
};
struct weston_output {