[PATCH weston 10/10] compositor-wayland: Simplify fullscreening for sprawl use case

Armin Krezović krezovic.armin at gmail.com
Sun Oct 9 15:30:31 UTC 2016


wayland_output_set_fullscreen() already takes care of
everything and xdg_shell doesn't use any present methods
so a single call to wayland_output_set_fullscreen() is
sufficient.

Signed-off-by: Armin Krezović <krezovic.armin at gmail.com>
---
 libweston/compositor-wayland.c | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/libweston/compositor-wayland.c b/libweston/compositor-wayland.c
index 6d91208..328b170 100644
--- a/libweston/compositor-wayland.c
+++ b/libweston/compositor-wayland.c
@@ -853,7 +853,7 @@ wayland_output_set_windowed(struct wayland_output *output)
 static void
 wayland_output_set_fullscreen(struct wayland_output *output,
 			      enum wl_shell_surface_fullscreen_method method,
-			      uint32_t framerate, struct wl_output *target)
+			      struct wl_output *target)
 {
 	struct wayland_backend *b =
 		to_wayland_backend(output->base.compositor);
@@ -1162,25 +1162,17 @@ wayland_output_enable(struct weston_output *base)
 
 	if (b->sprawl_across_outputs) {
 		wayland_output_set_fullscreen(output,
-					      WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER,
-					      output->mode.refresh, output->parent.output);
-
-		if (output->parent.xdg_toplevel) {
-			zxdg_toplevel_v6_set_fullscreen(output->parent.xdg_toplevel,
-							output->parent.output);
-		} else if (b->parent.fshell) {
-			zwp_fullscreen_shell_v1_present_surface(b->parent.fshell,
-								output->parent.surface,
-								ZWP_FULLSCREEN_SHELL_V1_PRESENT_METHOD_CENTER,
-								output->parent.output);
+					      ZWP_FULLSCREEN_SHELL_V1_PRESENT_METHOD_CENTER,
+					      output->parent.output);
+
+		if (b->parent.fshell)
 			zwp_fullscreen_shell_mode_feedback_v1_destroy(
 				zwp_fullscreen_shell_v1_present_surface_for_mode(b->parent.fshell,
 										 output->parent.surface,
 										 output->parent.output,
 										 output->mode.refresh));
-		}
 	} else if (b->fullscreen) {
-		wayland_output_set_fullscreen(output, 0, 0, NULL);
+		wayland_output_set_fullscreen(output, 0, NULL);
 	} else {
 		wayland_output_set_windowed(output);
 	}
@@ -2358,7 +2350,7 @@ fullscreen_binding(struct weston_keyboard *keyboard, uint32_t time,
 		return;
 
 	if (input->output->frame)
-		wayland_output_set_fullscreen(input->output, 0, 0, NULL);
+		wayland_output_set_fullscreen(input->output, 0, NULL);
 	else
 		wayland_output_set_windowed(input->output);
 
-- 
2.10.1



More information about the wayland-devel mailing list