From 0da12b8b8de1f58c943f7294882e23ebd9cef4ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20Krezovi=C4=87?= Date: Thu, 30 Jun 2016 06:04:33 +0200 Subject: [PATCH] compositor: Switch to new surface/view mapped checks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch makes use of new flags which were introduced by previous patches to check if a surface/view is mapped v2: - Rebased to apply on git master - Added comments with link to discussion about proposed changes for weston_{surface,view}_is_mapped() Signed-off-by: Armin Krezović Reviewed-by: Pekka Paalanen --- libweston/compositor.c | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/libweston/compositor.c b/libweston/compositor.c index 5abef52e..771f1c94 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -1544,22 +1544,35 @@ weston_view_set_mask_infinite(struct weston_view *view) weston_view_schedule_repaint(view); } +/* Check if view should be displayed + * + * The indicator is set manually when assigning + * a view to a surface. + * + * This needs reworking. See the thread starting at: + * + * https://lists.freedesktop.org/archives/wayland-devel/2016-June/029656.html + */ WL_EXPORT bool weston_view_is_mapped(struct weston_view *view) { - if (view->output) - return true; - else - return false; + return view->is_mapped; } +/* Check if a surface has a view assigned to it + * + * The indicator is set manually when mapping + * a surface and creating a view for it. + * + * This needs to go. See the thread starting at: + * + * https://lists.freedesktop.org/archives/wayland-devel/2016-June/029656.html + * + */ WL_EXPORT bool weston_surface_is_mapped(struct weston_surface *surface) { - if (surface->output) - return true; - else - return false; + return surface->is_mapped; } static void