[PATCH weston v6 20/73] weston: migrate x11 to head-based output API

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


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

Migrate the x11 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 | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/compositor/main.c b/compositor/main.c
index 5a2cec97..5d5ff248 100644
--- a/compositor/main.c
+++ b/compositor/main.c
@@ -1531,10 +1531,9 @@ out:
 	return ret;
 }
 
-static void
-x11_backend_output_configure(struct wl_listener *listener, void *data)
+static int
+x11_backend_output_configure(struct weston_output *output)
 {
-	struct weston_output *output = data;
 	struct wet_output_config defaults = {
 		.width = 1024,
 		.height = 600,
@@ -1542,10 +1541,7 @@ x11_backend_output_configure(struct wl_listener *listener, void *data)
 		.transform = WL_OUTPUT_TRANSFORM_NORMAL
 	};
 
-	if (wet_configure_windowed_output_from_config(output, &defaults) < 0)
-		weston_log("Cannot configure output \"%s\".\n", output->name);
-
-	weston_output_enable(output);
+	return wet_configure_windowed_output_from_config(output, &defaults);
 }
 
 static int
@@ -1581,6 +1577,8 @@ load_x11_backend(struct weston_compositor *c,
 	config.base.struct_version = WESTON_X11_BACKEND_CONFIG_VERSION;
 	config.base.struct_size = sizeof(struct weston_x11_backend_config);
 
+	wet_set_simple_head_configurator(c, x11_backend_output_configure);
+
 	/* load the actual backend and configure it */
 	ret = weston_compositor_load_backend(c, WESTON_BACKEND_X11,
 					     &config.base);
@@ -1588,8 +1586,6 @@ load_x11_backend(struct weston_compositor *c,
 	if (ret < 0)
 		return ret;
 
-	wet_set_pending_output_handler(c, x11_backend_output_configure);
-
 	api = weston_windowed_output_get_api(c);
 
 	if (!api) {
-- 
2.13.6



More information about the wayland-devel mailing list