xdg-shell: Take a xdg_surface as the parent surface

There is no other valid surface that we should be using here.

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
diff --git a/clients/window.c b/clients/window.c
index c5082ba..7b12227 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -253,7 +253,7 @@
 	struct xdg_popup *xdg_popup;
 
 	struct window *parent;
-	struct wl_surface *last_parent_surface;
+	struct window *last_parent;
 
 	struct ivi_surface *ivi_surface;
 
@@ -4031,21 +4031,21 @@
 static void
 window_sync_parent(struct window *window)
 {
-	struct wl_surface *parent_surface;
+	struct xdg_surface *parent_surface;
 
 	if (!window->xdg_surface)
 		return;
 
+	if (window->parent == window->last_parent)
+		return;
+
 	if (window->parent)
-		parent_surface = window->parent->main_surface->surface;
+		parent_surface = window->parent->xdg_surface;
 	else
 		parent_surface = NULL;
 
-	if (parent_surface == window->last_parent_surface)
-		return;
-
 	xdg_surface_set_parent(window->xdg_surface, parent_surface);
-	window->last_parent_surface = parent_surface;
+	window->last_parent = window->parent;
 }
 
 static void