libweston-desktop/{wl_shell, xwayland}: Fix changing between toplevel states

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Tested-by: Emmanuel Gil Peyrot <emmanuel.peyrot@collabora.com>
diff --git a/libweston-desktop/xwayland.c b/libweston-desktop/xwayland.c
index da04f7f..cb08323 100644
--- a/libweston-desktop/xwayland.c
+++ b/libweston-desktop/xwayland.c
@@ -75,8 +75,10 @@
 
 	assert(state != NONE);
 
-	if (to_add && surface->added)
+	if (to_add && surface->added) {
+		surface->state = state;
 		return;
+	}
 
 	if (surface->state != state) {
 		if (surface->state == XWAYLAND) {