diff --git a/libweston-desktop/xwayland.c b/libweston-desktop/xwayland.c
index f7c61e17ba6010648671d3c872543176d1109348..41bc4c895c8693cd0e83d8ce55a7cffc806eb471 100644
--- a/libweston-desktop/xwayland.c
+++ b/libweston-desktop/xwayland.c
@@ -83,6 +83,8 @@ weston_desktop_xwayland_surface_change_state(struct weston_desktop_xwayland_surf
 
 	if (surface->state != state) {
 		if (surface->state == XWAYLAND) {
+			assert(!surface->added);
+
 			weston_desktop_surface_unlink_view(surface->view);
 			weston_view_destroy(surface->view);
 			surface->view = NULL;
@@ -100,6 +102,8 @@ weston_desktop_xwayland_surface_change_state(struct weston_desktop_xwayland_surf
 		}
 
 		if (state == XWAYLAND) {
+			assert(!surface->added);
+
 			surface->view =
 				weston_desktop_surface_create_view(surface->surface);
 			weston_layer_entry_insert(&surface->xwayland->layer.view_list,