[PATCH weston v5 22/36] weston: migrate RDP to head-based output API

Pekka Paalanen ppaalanen at gmail.com
Thu Dec 14 11:40:59 UTC 2017


From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>

Migrate the RDP frontend to use the new head-based output configuration
API: listen for heads_changed, and process all heads.

Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
---
 compositor/main.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/compositor/main.c b/compositor/main.c
index 939201b3..55947675 100644
--- a/compositor/main.c
+++ b/compositor/main.c
@@ -1502,10 +1502,9 @@ load_headless_backend(struct weston_compositor *c,
 	return 0;
 }
 
-static void
-rdp_backend_output_configure(struct wl_listener *listener, void *data)
+static int
+rdp_backend_output_configure(struct weston_output *output)
 {
-	struct weston_output *output = data;
 	struct wet_compositor *compositor = to_wet_compositor(output->compositor);
 	struct wet_output_config *parsed_options = compositor->parsed_options;
 	const struct weston_rdp_output_api *api = weston_rdp_output_get_api(output->compositor);
@@ -1516,7 +1515,7 @@ rdp_backend_output_configure(struct wl_listener *listener, void *data)
 
 	if (!api) {
 		weston_log("Cannot use weston_rdp_output_api.\n");
-		return;
+		return -1;
 	}
 
 	if (parsed_options->width)
@@ -1531,10 +1530,10 @@ rdp_backend_output_configure(struct wl_listener *listener, void *data)
 	if (api->output_set_size(output, width, height) < 0) {
 		weston_log("Cannot configure output \"%s\" using weston_rdp_output_api.\n",
 			   output->name);
-		return;
+		return -1;
 	}
 
-	weston_output_enable(output);
+	return 0;
 }
 
 static void
@@ -1579,14 +1578,14 @@ load_rdp_backend(struct weston_compositor *c,
 
 	parse_options(rdp_options, ARRAY_LENGTH(rdp_options), argc, argv);
 
+	wet_set_simple_head_configurator(c, rdp_backend_output_configure);
+
 	ret = weston_compositor_load_backend(c, WESTON_BACKEND_RDP,
 					     &config.base);
 
 	if (ret < 0)
 		goto out;
 
-	wet_set_pending_output_handler(c, rdp_backend_output_configure);
-
 out:
 	free(config.bind_address);
 	free(config.rdp_key);
-- 
2.13.6



More information about the wayland-devel mailing list