backend-vnc: set head properties in vnc_head_create

Set static monitor strings and physical size once, on head creation.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
This commit is contained in:
Philipp Zabel 2022-12-03 10:59:30 +01:00 committed by Philipp Zabel
parent 233e056b50
commit 853eb7327f
1 changed files with 2 additions and 7 deletions

View File

@ -728,6 +728,8 @@ vnc_head_create(struct weston_compositor *compositor, const char *name)
head = xzalloc(sizeof *head);
weston_head_init(&head->base, name);
weston_head_set_monitor_strings(&head->base, "weston", "vnc", NULL);
weston_head_set_physical_size(&head->base, 0, 0);
head->base.backend_id = vnc_head_destroy;
@ -881,19 +883,12 @@ vnc_output_set_size(struct weston_output *base, int width, int height)
{
struct vnc_output *output = to_vnc_output(base);
struct vnc_backend *backend = to_vnc_backend(base->compositor);
struct weston_head *head;
struct weston_mode *current_mode;
struct weston_mode init_mode;
/* We can only be called once. */
assert(!output->base.current_mode);
wl_list_for_each(head, &output->base.head_list, output_link) {
weston_head_set_monitor_strings(head, "weston", "vnc", NULL);
weston_head_set_physical_size(head, 0, 0);
}
wl_list_init(&output->peers);
init_mode.flags = WL_OUTPUT_MODE_CURRENT | WL_OUTPUT_MODE_PREFERRED;