From f054d35aad567569bc86c2a45554ff4e23f4e8db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20Krezovi=C4=87?= Date: Sun, 9 Oct 2016 17:30:27 +0200 Subject: [PATCH] compositor-wayland: Simplify fullscreen output surface handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Armin Krezović --- libweston/compositor-wayland.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/libweston/compositor-wayland.c b/libweston/compositor-wayland.c index aa7e4266..46dbe6c2 100644 --- a/libweston/compositor-wayland.c +++ b/libweston/compositor-wayland.c @@ -645,10 +645,7 @@ wayland_output_disable(struct weston_output *base) wl_egl_window_destroy(output->gl.egl_window); } - /* Done on output->enable when not fullscreen, otherwise - * done in output_create, to get the proper mode */ - if (!b->fullscreen) - wayland_backend_destroy_output_surface(output); + wayland_backend_destroy_output_surface(output); if (output->frame) frame_destroy(output->frame); @@ -665,13 +662,9 @@ static void wayland_output_destroy(struct weston_output *base) { struct wayland_output *output = to_wayland_output(base); - struct wayland_backend *b = to_wayland_backend(base->compositor); wayland_output_disable(&output->base); - if (b->fullscreen) - wayland_backend_destroy_output_surface(output); - weston_output_destroy(&output->base); free(output); @@ -1068,15 +1061,12 @@ wayland_output_enable(struct weston_output *base) struct wayland_backend *b = to_wayland_backend(base->compositor); int ret = 0; - weston_log("Creating %dx%d wayland output at (%d, %d)\n", output->base.current_mode->width, output->base.current_mode->height, output->base.x, output->base.y); - /* If fullscreen was specified, this needs to be done before - * enable to get the proper mode */ - if (!b->fullscreen) + if (!output->parent.surface) ret = wayland_backend_create_output_surface(output); if (ret < 0) @@ -1132,8 +1122,7 @@ wayland_output_enable(struct weston_output *base) return 0; err_output: - if (!b->fullscreen) - wayland_backend_destroy_output_surface(output); + wayland_backend_destroy_output_surface(output); return -1; }