[PATCH weston 1/2] libweston-desktop/xdg_shell_v6: Check for buffer directly in committed

Quentin Glidic sardemff7+wayland at sardemff7.net
Mon Aug 15 11:51:41 UTC 2016


From: Quentin Glidic <sardemff7+git at sardemff7.net>

This is what we are interested in for real, and new_buffer is wrongly
named.

Signed-off-by: Quentin Glidic <sardemff7+git at sardemff7.net>
---
 libweston-desktop/xdg-shell-v6.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libweston-desktop/xdg-shell-v6.c b/libweston-desktop/xdg-shell-v6.c
index 1aa8b0c..87b8ca8 100644
--- a/libweston-desktop/xdg-shell-v6.c
+++ b/libweston-desktop/xdg-shell-v6.c
@@ -577,20 +577,20 @@ weston_desktop_xdg_toplevel_set_size(struct weston_desktop_surface *dsurface,
 
 static void
 weston_desktop_xdg_toplevel_committed(struct weston_desktop_xdg_toplevel *toplevel,
-				      bool new_buffer, int32_t sx, int32_t sy)
+				      int32_t sx, int32_t sy)
 {
 	struct weston_surface *wsurface =
 		weston_desktop_surface_get_surface(toplevel->base.desktop_surface);
 	bool reconfigure = false;
 
-	if (!new_buffer && !toplevel->added) {
+	if (!wsurface->buffer_ref.buffer && !toplevel->added) {
 		weston_desktop_api_surface_added(toplevel->base.desktop,
 					         toplevel->base.desktop_surface);
 		weston_desktop_xdg_surface_schedule_configure(&toplevel->base);
 		toplevel->added = true;
 		return;
 	}
-	if (!new_buffer)
+	if (!wsurface->buffer_ref.buffer)
 		return;
 
 	if (toplevel->next_state.maximized || toplevel->next_state.fullscreen)
@@ -1005,7 +1005,7 @@ weston_desktop_xdg_surface_committed(struct weston_desktop_surface *dsurface,
 {
 	struct weston_desktop_xdg_surface *surface = user_data;
 
-	if (new_buffer && !surface->configured) {
+	if (wsurface->buffer_ref.buffer && !surface->configured) {
 		wl_resource_post_error(surface->resource,
 				       ZXDG_SURFACE_V6_ERROR_UNCONFIGURED_BUFFER,
 				       "xdg_surface has never been configured");
@@ -1025,7 +1025,7 @@ weston_desktop_xdg_surface_committed(struct weston_desktop_surface *dsurface,
 				       "xdg_surface must have a role");
 		break;
 	case WESTON_DESKTOP_XDG_SURFACE_ROLE_TOPLEVEL:
-		weston_desktop_xdg_toplevel_committed((struct weston_desktop_xdg_toplevel *) surface, new_buffer, sx, sy);
+		weston_desktop_xdg_toplevel_committed((struct weston_desktop_xdg_toplevel *) surface, sx, sy);
 		break;
 	case WESTON_DESKTOP_XDG_SURFACE_ROLE_POPUP:
 		weston_desktop_xdg_popup_committed((struct weston_desktop_xdg_popup *) surface);
-- 
2.9.2



More information about the wayland-devel mailing list