[PATCH weston v6 23/73] weston: migrate RDP to head-based output API

Pekka Paalanen ppaalanen at gmail.com
Fri Feb 16 14:57:08 UTC 2018


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 3905c3ba..02f20d13 100644
--- a/compositor/main.c
+++ b/compositor/main.c
@@ -1387,10 +1387,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);
@@ -1401,7 +1400,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)
@@ -1416,10 +1415,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
@@ -1464,14 +1463,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