[PATCH weston v4 10/15] compositor-wayland: Add a --sprawl option

Jason Ekstrand jason at jlekstrand.net
Tue Feb 25 17:26:42 PST 2014


This forces weston to create one output for every parent output.  This is
enabled by default if it detects a wl_fullscreen_shell.  The --sprawl
option is primarily to enable this on wl_shell.

Signed-off-by: Jason Ekstrand <jason at jlekstrand.net>
---
 src/compositor-wayland.c | 10 +++++++---
 src/compositor.c         |  1 +
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c
index 1e97a4f..fc9c9b5 100644
--- a/src/compositor-wayland.c
+++ b/src/compositor-wayland.c
@@ -64,6 +64,7 @@ struct wayland_compositor {
 	} parent;
 
 	int use_pixman;
+	int sprawl_across_outputs;
 
 	struct theme *theme;
 	cairo_device_t *frame_device;
@@ -1710,7 +1711,7 @@ wayland_compositor_register_output(struct wayland_compositor *c, uint32_t id)
 	wl_list_init(&output->mode_list);
 	wl_list_insert(&c->parent.output_list, &output->link);
 
-	if (c->parent.fshell) {
+	if (c->sprawl_across_outputs) {
 		wl_display_roundtrip(c->parent.wl_display);
 		wayland_output_create_for_parent_output(c, output);
 	}
@@ -1991,7 +1992,7 @@ backend_init(struct wl_display *display, int *argc, char *argv[],
 	struct wayland_output *output;
 	struct wayland_parent_output *poutput;
 	struct weston_config_section *section;
-	int x, count, width, height, scale, use_pixman, fullscreen;
+	int x, count, width, height, scale, use_pixman, fullscreen, sprawl;
 	const char *section_name, *display_name;
 	char *name;
 
@@ -2003,6 +2004,7 @@ backend_init(struct wl_display *display, int *argc, char *argv[],
 		{ WESTON_OPTION_BOOLEAN, "use-pixman", 0, &use_pixman },
 		{ WESTON_OPTION_INTEGER, "output-count", 0, &count },
 		{ WESTON_OPTION_BOOLEAN, "fullscreen", 0, &fullscreen },
+		{ WESTON_OPTION_BOOLEAN, "sprawl", 0, &sprawl },
 	};
 
 	width = 0;
@@ -2012,6 +2014,7 @@ backend_init(struct wl_display *display, int *argc, char *argv[],
 	use_pixman = 0;
 	count = 1;
 	fullscreen = 0;
+	sprawl = 0;
 	parse_options(wayland_options,
 		      ARRAY_LENGTH(wayland_options), argc, argv);
 
@@ -2020,7 +2023,8 @@ backend_init(struct wl_display *display, int *argc, char *argv[],
 	if (!c)
 		return NULL;
 	
-	if (c->parent.fshell) {
+	if (sprawl || c->parent.fshell) {
+		c->sprawl_across_outputs = 1;
 		wl_display_roundtrip(c->parent.wl_display);
 
 		wl_list_for_each(poutput, &c->parent.output_list, link)
diff --git a/src/compositor.c b/src/compositor.c
index 9de3a90..f04bcf9 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -3955,6 +3955,7 @@ usage(int error_code)
 		"  --fullscreen\t\tRun in fullscreen mode\n"
 		"  --use-pixman\t\tUse the pixman (CPU) renderer\n"
 		"  --output-count=COUNT\tCreate multiple outputs\n"
+		"  --sprawl\t\tCreate one fullscreen output for every parent output\n"
 		"  --display=DISPLAY\tWayland display to connect to\n\n");
 
 #if defined(BUILD_RPI_COMPOSITOR) && defined(HAVE_BCM_HOST)
-- 
1.8.5.3



More information about the wayland-devel mailing list