From d1dd0a6970649d9f2c0eeed30da0eff745f16dd1 Mon Sep 17 00:00:00 2001 From: Tony Crisci Date: Sun, 22 Oct 2017 21:07:32 -0400 Subject: refactor buffer detection --- include/wlr/types/wlr_surface.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/wlr/types/wlr_surface.h b/include/wlr/types/wlr_surface.h index 461e593f..ea4184aa 100644 --- a/include/wlr/types/wlr_surface.h +++ b/include/wlr/types/wlr_surface.h @@ -109,6 +109,14 @@ void wlr_surface_get_matrix(struct wlr_surface *surface, int wlr_surface_set_role(struct wlr_surface *surface, const char *role, struct wl_resource *error_resource, uint32_t error_code); +/** + * Whether or not this surface currently has an attached buffer. A surface has + * an attached buffer when it commits with a non-null buffer in its pending + * state. A surface will not have a buffer if it has never committed one, has + * committed a null buffer, or something went wrong with uploading the buffer. + */ +bool wlr_surface_has_buffer(struct wlr_surface *surface); + /** * Create the subsurface implementation for this surface. */ -- cgit v1.2.3