diff --git a/libweston-desktop/xdg-shell-v6.c b/libweston-desktop/xdg-shell-v6.c index 955fccad..ff3a6344 100644 --- a/libweston-desktop/xdg-shell-v6.c +++ b/libweston-desktop/xdg-shell-v6.c @@ -645,11 +645,11 @@ weston_desktop_xdg_toplevel_committed(struct weston_desktop_xdg_toplevel *toplev struct weston_surface *wsurface = weston_desktop_surface_get_surface(toplevel->base.desktop_surface); - if (!wsurface->buffer_ref.buffer && !toplevel->added) { + if (!weston_surface_has_content(wsurface) && !toplevel->added) { weston_desktop_xdg_toplevel_ensure_added(toplevel); return; } - if (!wsurface->buffer_ref.buffer) + if (!weston_surface_has_content(wsurface)) return; struct weston_geometry geometry = @@ -1209,7 +1209,7 @@ weston_desktop_xdg_surface_committed(struct weston_desktop_surface *dsurface, struct weston_surface *wsurface = weston_desktop_surface_get_surface (dsurface); - if (wsurface->buffer_ref.buffer && !surface->configured) { + if (weston_surface_has_content(wsurface) && !surface->configured) { wl_resource_post_error(surface->resource, ZXDG_SURFACE_V6_ERROR_UNCONFIGURED_BUFFER, "xdg_surface has never been configured"); @@ -1397,7 +1397,7 @@ weston_desktop_xdg_shell_protocol_get_xdg_surface(struct wl_client *wl_client, if (surface->resource == NULL) return; - if (wsurface->buffer_ref.buffer != NULL) { + if (weston_surface_has_content(wsurface)) { wl_resource_post_error(surface->resource, ZXDG_SURFACE_V6_ERROR_UNCONFIGURED_BUFFER, "xdg_surface must not have a buffer at creation"); diff --git a/libweston-desktop/xdg-shell.c b/libweston-desktop/xdg-shell.c index 6cbf55e4..4b0509b1 100644 --- a/libweston-desktop/xdg-shell.c +++ b/libweston-desktop/xdg-shell.c @@ -693,11 +693,11 @@ weston_desktop_xdg_toplevel_committed(struct weston_desktop_xdg_toplevel *toplev struct weston_surface *wsurface = weston_desktop_surface_get_surface(toplevel->base.desktop_surface); - if (!wsurface->buffer_ref.buffer && !toplevel->added) { + if (!weston_surface_has_content(wsurface) && !toplevel->added) { weston_desktop_xdg_toplevel_ensure_added(toplevel); return; } - if (!wsurface->buffer_ref.buffer) + if (!weston_surface_has_content(wsurface)) return; struct weston_geometry geometry = @@ -1351,7 +1351,7 @@ weston_desktop_xdg_surface_committed(struct weston_desktop_surface *dsurface, struct weston_surface *wsurface = weston_desktop_surface_get_surface (dsurface); - if (wsurface->buffer_ref.buffer && !surface->configured) { + if (weston_surface_has_content(wsurface) && !surface->configured) { wl_resource_post_error(surface->resource, XDG_SURFACE_ERROR_UNCONFIGURED_BUFFER, "xdg_surface has never been configured"); @@ -1518,7 +1518,7 @@ weston_desktop_xdg_shell_protocol_get_xdg_surface(struct wl_client *wl_client, return; } - if (wsurface->buffer_ref.buffer != NULL) { + if (weston_surface_has_content(wsurface)) { wl_resource_post_error(resource, XDG_SURFACE_ERROR_UNCONFIGURED_BUFFER, "xdg_surface must not have a buffer at creation");