From 0ece6cb436504149002f30c131230bf077db2a73 Mon Sep 17 00:00:00 2001 From: Philipp Zabel Date: Sun, 29 May 2022 10:27:10 +0200 Subject: [PATCH] compositor: configure VNC output size via weston.ini Use parse_simple_mode() to allow configuring the VNC framebuffer size with a mode property in weston.ini, like this: [output] name=vnc mode=1280x720 Signed-off-by: Philipp Zabel --- compositor/main.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/compositor/main.c b/compositor/main.c index fe8be427..47de4179 100644 --- a/compositor/main.c +++ b/compositor/main.c @@ -3138,11 +3138,17 @@ load_rdp_backend(struct weston_compositor *c, static int vnc_backend_output_configure(struct weston_output *output) { + struct wet_output_config defaults = { + .width = 640, + .height = 480, + }; struct wet_compositor *compositor = to_wet_compositor(output->compositor); struct wet_output_config *parsed_options = compositor->parsed_options; const struct weston_vnc_output_api *api = weston_vnc_output_get_api(output->compositor); - int width = 640; - int height = 480; + struct weston_config *wc = wet_get_config(output->compositor); + struct weston_config_section *section; + int width; + int height; assert(parsed_options); @@ -3151,11 +3157,10 @@ vnc_backend_output_configure(struct weston_output *output) return -1; } - if (parsed_options->width) - width = parsed_options->width; + section = weston_config_get_section(wc, "output", "name", output->name); - if (parsed_options->height) - height = parsed_options->height; + parse_simple_mode(output, section, &width, &height, &defaults, + compositor->parsed_options); weston_output_set_scale(output, 1); weston_output_set_transform(output, WL_OUTPUT_TRANSFORM_NORMAL);